I just finished watching Days of Heaven, and one of the shots amazed me. Were railways like this very common throughout America? Why would such a high elevation be beneficial? When were they built?
That isn't exactly an elevated railroad. An elevated railroad is a railway built continuously above the terrain. They are generally used in urban areas where tunneling would be expensive and street-running would cause too much congestion. Major cities in the US often had them, built in the early 1900s. Many were later seen as eyesores and torn down, but they still exist in Chicago and New York. Here are some pictures of Boston's former elevated system:
https://upload.wikimedia.org/wikipedia/commons/7/76/City_Square_station%2C_March_1901.jpg
https://upload.wikimedia.org/wikipedia/commons/3/33/Green_Line_trolley_next_to_Central_Artery_2.jpg
Sometimes regular railroads have short elevated portions, to bridge densely built areas. The descendants of the elevated railroad are things like this, a smaller elevated transit system for use in city centers.
What's in your picture is just a very large trestle. The railroad itself isn't elevated, and does not stay at that height for a significant length. The bridge is over a river or valley (or both), the shot simply is too close in to see that. Unlike the above examples, the railway itself is not elevated, it's just a (very large) bridge. Building an entire railroad like that would be expensive and impractical.
Here are some railroad bridges with a similar scale:
https://upload.wikimedia.org/wikipedia/commons/d/dc/Phot_kinzuabridge2.jpg
https://upload.wikimedia.org/wikipedia/commons/c/c4/Steamtown-Nicholson-Viaduct.JPG
https://upload.wikimedia.org/wikipedia/commons/7/7e/Portage_Viaduct.jpg
Unfortunately I can't find the exact bridge pictured in that shot. But, it has the definite appearance of a railway trestle over a river or valley. These are not particularly common, but America is a big place and there a lot of rivers and valleys to bridge.