Some EU countries (Greece, Poland, Portugal) still have terrible, slow trains. Paris-Berlin takes 8h (fastest one) for about 877 km. Berlin-Gdansk takes 8h for about 400 km (!!).
I last traveled by night train about 20 years ago throughout Germany and Poland. It was terrible experience. But great if I was looking for a companion to beer, or surprise sex with random folk.
Also night trains are non-existent in some countries. For example in the UK, most trains run from 6am onwards on week days. Forget if you need to travel from York and be in London for 8am. We have some night services[0] that go out of London to Scotland/Cornwall but I see them more like touristic offer than for any economic reason.
[0] https://www.nationalrail.co.uk/on-the-train/sleeper-trains/