Interesting scenario but still rather unlikely even putting aside the fact that in OTL Esterhazy was put on a trial in 1898 and found not guilty. Even if he is found guilty and fled to Germany, the war hardly could be started over a single spy who is a French national. Extradition agreements were not common and I’m not sure that one existed between France and Germany. Then, the most improbable part is that France is provoking a war: this would take Russia off the hook because the existing treaty of a mutual defense was valid only in the case of a German attack. France could not fight Germany alone and 5his ruins the whole premise of her being initiator of the war.
I did this scenario in thirty seconds, so yes, there must be a lot of loopholes.
But one could imagine that Esterhazy fleeing to Germany would cause overexcitement on both sides and that the soldiers at the border would have fun insulting each other. Then a warmer-blooded German officer thought it was a good idea to cross the border to send a "message" to the French. (🤪).
Although Esterhazy is the "beginning of the fuse" the conflict will probably come back to the Alsace-Lorraine dispute and if, as I wrote above, Germany is seen as the aggressor, Russia could join France with less difficulty.
Edit: one could imagine a total absence of the Dreyfus affair, more competent and not antisemitic officers discover Esterhazy at the beginning of their investigation and never pay attention to Dreyfus.