At the time of the Franco-Prussian war…
1864 CE to 1875 CE
At the time of the Franco-Prussian war in 1870, despite allegations about French use of the Luxembourg railways for passing soldiers from Metz (at this time part of France) through the Duchy, and for forwarding provisions to Thionville, Luxembourg's neutrality is respected by Germany, and neither France nor Germany invades the country, but in 1871, as a result of Germany's victory over France, Luxembourg's boundary with Lorraine, containing Metz and Thionville, changes from being a frontier with a part of France to a frontier with territory annexed to the German Empire as Alsace-Lorraine under the Treaty of Frankfurt.
This allows Germany the military advantage of controlling and expanding the railways there.