I took a night train once in Japan, which while it was an interesting experience and I'm glad that I did it, it was rather hard to actually sleep. You can't get around the fact that you're constantly being shunted back and forth. It's also noisy because of the contact with the rails, and the noise is irregular unlike the noisy but regular sound of air and turbines on a plane.
Edit: I believe it was this service, now discontinued: https://jprail.com/trains/sort-by-type/overnight-trains/over...