Before the 1950s, all railroad tracks in the U.S. were laid and maintained by hand labor. In the segregated South, this work was mainly done by Black men.
The section crews responsible for maintaining the tracks were sometimes known as gandy dancers, probably because of the coordinated rhythmic movements required for repositioning tracks that had become misaligned. They synchronized their movements with call-and-response singing of improvised couplets and stock refrains.
The tradition is documented in Gandy dancers by Maggie Holtzberg and Barry Dornfeld (Cinema Guild, 1994; RILM Abstracts of Music Literature 1999-38971).
Below, the trailer for the film; the complete 30-minute film can be viewed here.