Trains are heavy, monstrously heavy, so that weight helps with the lack of friction somewhat.
The engines also have grit blowers (basically sand) in front of the driving wheels to increase friction and thus traction so the machine can get moving.
Once a train gets moving, it takes little energy to keep them moving, so there are quite a few benefits to using steel on steel to move goods around.
There are other methods as well, especially for dealing with inclines and declines but that is getting deep into the process.
Latest Answers