Trains for people have a few cars and go really fast. Trains for cargo have hundreds of cars and go really slow.
Right now the trains may be ahead in some regions thanks to their slow speeds, and thanks to the electrification - with the assumption electricity is generated from sources other than fossil fuel.
But if you tried to set up railway at travel time comparable to airways, you'd quickly find yourself doing away with rolling in favor of maglev or maybe air cushion, and also trying to lower the air drag as much as possible. Both are non-trivial engineering challenges - cue the Hyperloop languishing in protracted development. Both have been solved by air travel decades ago.
Meanwhile electrification of the air travel is already underway. Quiet SSTs[1] are up next. And yes, SSTs are rather fuel efficient, thanks to the even higher operating altitude, and also the natural efficiency of the jets at high speeds.
I will miss the railways. It used to be a great adventure back when I was a kid.
[0] well if you disregard travel time, then the sailing ships would be the kings
[1] relevant: the X-59, and the Boom
"Trains in countries like Japan are predominantly electric and transport a much larger number of people per cabin than trains in the US. While it’s difficult to broadly compare trains between regions it’s safe to say that trains in European and Asian countries are far more fuel efficient than those in the US, making them a leading option for travel.
In most cases outside of the US, trains are probably at least as efficient as buses and are much more efficient than cars and planes."
Yours, Physics.