From the early days of the Spanish Conquest the Isthmus of Tehuantepec was recognized as an important highway from the Atlantic to the Pacific. Situated at the extreme southern boundary of Mexico, the Isthmus, with the exception of Panama, is the narrowest neck of land on the American continent. Cortes, it is said, conceived the idea of building a canal across it; but as this was not feasible, a carriage road was constructed by the Spaniards. Engineers in later times recommended this route for a canal in preference to Panama, the distance in a straight line being only one hundred and twenty-five miles from the Atlantic to the Pacific.
When the Panama project under French management proved a failure, President Diaz, with his customary fore-sight, proposed a railway across the Isthmus of Tehuantepec, the idea being to unload vessels on the Atlantic or Pacific side and take the cargoes across the Isthmus for reshipment.
The plan was formally carried out, and the railway was completed in 1894. When opened to traffic, however, it proved to be imperfect, so in 1899 the Mexican government entered into an agreement with the English firm of S. Pearson & Sons, whereby they and the government were to be joint owners of the railway for fifty-one years and to share the net earnings. Although the construction was extremely difficult,! owing to the nature of the country traversed by the line, which included some deep canons, numerous rocky cuttings and miles of swampy land, the work was eventually finished, and the line, which ,is one hundred and ninety miles in length, was opened to traffic. The work was well done, and to-day the railway is one of the best in Mexico and excellently managed. It is also one of the few railways in the world which uses oil for fuel.
http://www.oldandsold.com/articles21/mexico-19.shtml
Of course, building a railroad is different than finding a reasonable route for running, but I still thought it gave pertinent information.