How Europe's night trains came back from the dead
https://edition.cnn.com/travel/article/night-trains-europe-sleeper-obb/index.html
As the article says, space per each passenger on night trains is wider than that on airplanes. But, it means cost per each passenger is also more expensive than that on airplanes.
So, railway companies don't have any way to solve this problem. To let more people board night trains, government aid would be needed.