1757, from rail (n.1) + road. Originally "road laid with rails for heavy wagons" in mining operations. The process itself (but not the word) seems to have been in use by late 17c. Application to passenger and freight trains dates from 1825, tending to be replaced in this sense in England by railway.
"anything inferior," 1940s, agent noun from clunk (v.), probably in imitation of the sounds made by old machinery. Specific sense of "old car" was in use by 1936.