When you click on links to various merchants on this site and make a purchase, this can result in this site earning a commission. Affiliate programs and affiliations include, but are not limited to, the eBay Partner Network.
But wouldn't the RR have a car with a crane on it?
Yes. They would have brought out one or two wreck cranes to upright the locomotive. Today they use huge Caterpillar earth movers with "sidebooms" to right cars.
It depends on the location. Sometimes they use(d) modified pipelayers (that's an oldie, there are much bigger ones nowadays).
The D8 Cat didn’t come out until 1935. That wreck looks too old for that. I think that they would have used a couple locomotive cranes per your picture.