But after thinking about how other songs did it, I realized that at least part of how Wilson's song emulates a train is the sound of the words.
Cash for the merchandiseEach line's starting with "cash" provides the sound of the train's engine getting started - the onomatopoeic chugging of the train. Also, as the later lines are longer, you start to get the feeling that the train is picking up momentum.
Cash for the button hooks
Cash for the cotton goods
Cash for the hard goods
Cash for the fancy goods
Cash for the soft goods
Cash for the noggins and the piggins and the frikins
Cash for the hog's head, cask, and demijohns
Cash for the crackers and the pickles and the flypaper
There are other ways in which the song emulates train sounds, but I think this is one of the most important.