From From the River to the Sea: The Untold Story of the Railroad War That Made the West, by John Sedgwick (Avid Reader / Simon & Schuster, 2021), Kindle p. 111:
A shoo-fly is a type of switchback, but with a pronounced zigzag that allows a train to ascend a steep mountainside. Sketched out, the route looks like a child’s drawing of the edge of a Christmas tree; each curved-up branch is a shoo-fly. To ascend, a train fires up its engines to run as high as it can on the bottom “branch.” When the going gets too steep, the engineer throws the train into reverse to run back up onto another set of tracks that are set at a higher elevation than the previous one. After rolling back as far as it can, the train then charges up the mountain once more, this time on another set of tracks that are placed still higher, and so on and on, forward and back and forward again, until the train catapults itself over the top.
There was nothing like it anywhere in North America, but Robinson had heard of its use in Europe. Morley hoped the Santa Fe could get by with two such shoo-fly branches, but when he ran the numbers on the train’s weight, the locomotive’s thrust, and the track inclines, he realized that one locomotive could not provide enough power. He tried to add a third shoo-fly, but there wasn’t room, so he added another locomotive. When that wasn’t enough, he threw in a third. It worked.
Zigzag railways can be found in many mountainous countries. The first one the Far Outliers encountered was in 2011 on the Hōhi Main Line across central Kyushu between Oita and Kumamoto. Earlier this month on a trip around the Canadian Rockies, we experienced another method of avoiding steep grades on railway lines: the spiral tunnels through the Big Hill at Kicking Horse Pass in British Columbia.