Trains have in no way "lost out" to trucks. Rail transport is a huge and growing industry. But long haul trucks are sometimes preferred because they're faster. Our cargo transportation system needs both.
https://www.bts.gov/content/weight-shipments-transportation-...