I saw a reference to this issue last week in connection with moving military supplies into Ukraine. IIRC there might have been a military rationale for having different track gauges (distance between rails) between countries--making it impossible for an armored train or supply trains to cross borders as part of an invasion.
Here's a quote from a Politico piece on the nominee for NATO command:
He has also thrown himself into more intricate issues such as launching studies of railroad gauges and transportation infrastructure in Eastern Europe, which often still use Warsaw Pact standards, in an effort to smooth the movement of NATO troops and materiel.
Different gauges were a big problem in the early days of railroading, including during the Civil War.