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.
"to convict quickly and perhaps unjustly," 1873, American English, from railroad (n.) as the then-fastest form of travel.
A person knowing more than might be desirable of the affairs, or perhaps the previous life of some powerful individual, high in authority, might some day ventilate his knowledge, possibly before a court of justice; but if his wisdom is railroaded to State's prison, his evidence becomes harmless. ["Wanderings of a Vagabond," New York, 1873]
Related: Railroaded; railroading. An earlier verb sense was "to have a mania for building railroads" (1847).