There are a lot of assumptions in the idea that trains are more efficient than road vehicles. Trains tend to carry more heavy bulk goods like coal, if they had more light things the numbers would change. Trains get a lot of efficiency from running very long trains, but that only works out when you have a lot of things going the same way, if you had smaller trains from each warehouse (which now is done by truck) that would reduce th efficiency.
Yes trains have some efficiency advantages, but in similar service the difference is small. You only get those advantages when you use trains for things that trucks cannot do at all.
The very long trains of mostly goods like coal are not an inevitability, though— it's a result of rail companies implementing PSR in response to some pretty specific incentives, see:
A number of YouTube video essays argue the sides of this as well, here's one based around Sen. Sanders confronting a rail CEO in the wake of the recent Ohio derailment: https://youtu.be/e4w0q5NzCwA
Yes trains have some efficiency advantages, but in similar service the difference is small. You only get those advantages when you use trains for things that trucks cannot do at all.