Well, sure, it won't be easy, but just letting them murder humans for minor mistakes is equally silly. If they're willing to do that sort of shit, it just shows how little they care for human life.
I'm no general or strategist, so of course the best I can think of is to burn the fuckers down. Again, we wouldn't need to go through with it, we just need to scare them enough that they stop murdering people for no reason. And I think that pyrrhic victories would be very scary for a people with low replacement rates and long, long lifespans. Imagine going to war knowing that because of some cunt politician that hates metals you now need to risk your immortal, comfy life to kill some short lived apes that are basically acting out of self defence.
That'd sure do a number on their morale. And if the average elf still thinks killing people for having golden earrings is reasonable, how do you think they'll feel getting killed by humans?
It'd probably be the ultimate humilliation, to get killed by something that lives it's entire life in the time that it takes a child to mature. And all this because someone got angry at a horseshoe or something? yeah I don't think it'd feel so good.
I mean, look at the Vietnam war. The US was having some trouble, sure, but if you look at the numbers, they were doing incredibly well. Howeverm the consensus was that it just wasn't worth it to keep the war up. Even if it meant giving the commies an entire country and another foothold on Asia.
I think the elves would just cut their losses and either fuck off to some other forest or try for a peace treaty of sorts.
But how would you go through with it? How would you solve the problem of elf agression? If they're willing to kill humans for something so petty, I doubt it that they'd even bother with diplomacy if you don't have a big stick to scare them into it. And the threat of burning down everything they have seems like a big enough stick to me.