(chiefly US, idiomatic) A railway laborer, especially a member of a crew which carries rails and affixes them to ties.
Example: 1929, Vernon W. Saul, "The Vocabulary of Bums," American Speech, vol. 4, no. 5, p. 340:
Gandy dancerâ€”A section hand or track laborer.
1959 May 18, "Bush Teachers," Time (retrieved 14 Sep 2008):
The oddest gandy-dancer on the railroads in Manitoba during the summer of 1926 was a 6-ft. 4-in. American medical student named Ben Spock.
1981 May 3, Edward C. Burks, "Amtrak Changes on Schedule," New York Times (retrieved 11 June 2014):
In railroad slang, a gandy dancer is a track worker, one who lays or maintains track.