In the early 20th century, the steam locomotive was the king of land transportation. The railroad industry was one of the largest employers in the US, employing massive numbers of workers to build and maintain rails, operate and repair trains, and so on. Huge businesses and entire towns sprang up to meet the needs of the railroads and their workers and passengers.
But since then, American railroads have lost almost all of their passenger business and a significant portion of their freight business to highways or airlines. Technologies have also reduced the amount of labor needed to keep the trains running. Steam locomotives were replaced by diesel locomotives that required smaller crews, didn't have to stop for water, were more operationally flexible, and required much less maintenance (this documentary says 1,000,000 miles between major overhauls for diesels compared to 75,000 for steam). Instead of large crews of gandy dancers maintaining tracks with hand tools, heavy machinery allowed fewer workers to maintain much more track. Passenger services were severely cut back, especially luxuries like sleeping cars and dining cars which were also labor-intensive.
Overall, we can say that railroads shifted from employing large numbers of unskilled manual laborers to smaller numbers of more skilled workers (and at the same time as the demand for rail transport went down). It seems like we may see something similar in the near future with technologies like self-driving vehicles. What I'm wondering is, what happened to those railroad workers whose jobs became redundant? Did the railroad companies or unions give them other jobs? Did they receive pensions? Or were they simply fired and left to find whatever work they could? If so, did most of them find jobs (and what kind of jobs), or did many fall into poverty? What happened to towns that depended on railroads for their economy? Were there protests or strikes or other conflicts caused by these changes?
Edit to add some statistics: Page 15 of this document lists railroad employment statistics 1890-1957 and this page has 1947-2014. There are fewer people employed by railroads today (only 212,000) than there were even during the Great Depression (991,000 in 1933). Between 1951 and 1972, railroads lost an average of 40,000 jobs a year.