Well, you've piqued my interest. A lot of tough reading, sorting out Congressional acts, various construction companies and railroads and trackage agreements and disputes.
The photos are circa 1881-1892. The SP then found a straight route and built this bridge, which most info available depicts. So, the curvy route was most likely due to the elevation climb to El Paso and avoiding geological obstacles.
There are a few collections of actual railroad documents, but only the index is available on the web. The real answer will take some footwork.
Attached is someone's version of the old route(website is now dead) and a Sunset Route brochure from 1915 with a mention of El Paso.
I found this historical reference. Here is an excerpt:
"By the end of 1881 the Texas and Pacific had 1,034 miles of main track in Texas. In the meantime, the California-based Southern Pacific Railroad Company had constructed a line to the Colorado River across from Yuma, Arizona Territory, where it was to meet the Texas and Pacific. However, Collis P. Huntington and his associates decided not to wait and continued to build eastward, reaching El Paso in May 1881. They had acquired an interest in the Galveston, Harrisburg and San Antonio Railway Company and, under its charter, reached Sierra Blanca ahead of the Texas and Pacific. In its construction east from Yuma, the Southern Pacific occupied the line surveyed and designated by the Texas and Pacific as its right-of-way. This resulted in suits being filed against the Southern Pacific by the Texas and Pacific for possession of the line between El Paso and Yuma. The dispute was settled by the "Gould-Huntington Agreement" of November 26, 1881. Under terms of this agreement the Texas and Pacific was to build no further than Sierra Blanca, ninety-two miles east of El Paso. The two systems would use the line to El Paso jointly, forming one continuous line to the coast. The Texas and Pacific relinquished its property rights and franchises west of El Paso to the Southern Pacific. The agreement also provided for pooling, harmonious operation, and for the cooperation in the building of new lines. All of the provisions except that for the joint trackage have been nullified by subsequent laws. The Texas and Pacific later unsuccessfully tried in the courts and before the Interstate Commerce Commission to secure a one-half interest in the joint track."