1757, from rail
(n.1) + road
. Originally "road laid with rails for heavy wagons (in mining)." The system itself seems to have been in use by late 17c. Application to passenger and freight trains dates from 1825, though tending to be replaced in this sense in England by railway
(1812). The verb meaning "to convict quickly and perhaps unjustly" is from 1884.