early 14c., "a drawing out, delay," later "trailing part of a skirt" (mid-15c.), also "retinue, procession" (mid-15c.), from Old French train (fem. traine), from trainer "to pull, draw," from Vulgar Latin *traginare, extended from *tragere "to pull," back-formation from tractus, past participle of Latin trahere "to pull, draw" (see tract (n.1)).
Train of thought first attested 1650s. The railroad sense is recorded from 1820 (publication year, dated 1816), from notion of a "train" of wagons or carriages pulled by a mechanical engine.
"instruct, discipline, teach," 1540s, probably from earlier sense of "draw out and manipulate in order to bring to a desired form" (late 14c.), specifically of the growth of branches, vines, etc. from mid-15c.; from train (n.). The meaning "to travel by railway" is recorded from 1856. Related: Trained; training.