On the railroad
Foreign songs with completely different Japanese lyrics are relatively common in Japan, especially when it comes to songs for kids. The Meiji composers and lyricists tasked with coming up with a localized singing curriculum often resorted to this tactic. This is why in Japan everyone knows "Auld lang syne" as "By firefly light" (a reference to these guys, as it happens).
"I've been working on the railroad" was also relyricized, although much later. According to Wikipedia, the first translation was made in 1955, by TSUGAWA Shuichi 津川主一. This one was relatively faithful to the original, and starts with the line Senro no shigoto wa itsu made mo (basically, "Working on the railroad, for [what seems like] forever"). But the version everyone knows was translated in 1962 for the TV program Minna no uta ("Songs for everyone") by the director of the program GOTŌDA Sumio 後藤田純生, with help from friends and other staff. It goes like this:
Senro wa tsuzuku yo, doko made mo
No o koe, yama koe, tani koete
Haruka na machi made, bokutachi no
Tanoshii tabi no yume tsunaideru...
The railroad goes on, ever on
Through fields, over mountains, through valleys
Reaching distant towns, our
Pleasant dream of travel...
John Henry must really be rolling in that sand right about now.
Sgt Tanuki:
And Tolkien, too...