Cornelius "the Commodore" Vanderbilt became a multimillionaire running a railroad at a time when locomotives required a crew of two (engineer/fireman) and each train required multiple brakemen and a conductor, along with hospitality staff for passenger trains. Not to mention the thousands of signal operators, all replaced with a couple $600 pc's. This at a time when there were dozens of competitors.
When dealing with freight, there were no cargo containers, each boxcar had to be loaded and unloaded by hand, and oil was shipped in barrels that had to be moved one at a time (some rope/pulley system I believe). Nowadays a single person operating a crane can transfer the entire contents of a flatcar to a waiting truck in a single move (two if they are double stacked).
With all these advances they can't get their act together, but there is a reason for that: government intervention.
Government intervened to bankrupt the railroads in favor of the trucking industry. Forty years I read a book about regulations being used to kill competition. I believe the title was The Triumph of Conservatism.