Which leaders? I don't believe any of the players thought they would gain empire in Europe. Everyone was trying to be defensive, combined with slow communication and poor politics. Now that historians have access to much of the internal documentation it doesn't seem like an inevitable war. If only the Habsburgs had been more decisive, or Wilhelm more politically astute, instead of making grand gestures then going on a boating holiday with his British naval mates.
It's not that they needed an excuse to say no, it's that they each thought backing down would be worse. And tbh I don't think any the current leaders are better. Nicholas II "I will not become responsible for a monstrous slaughter" vs Putin's war of choice.