I did the whole North-to-South route by train last year and honestly, while the views out the window are nice, nothing compares to the epic railway journeys I read about in guides like this guide on
Scenic Train Tours in Switzerland. Vietnam's sleeper trains are a fun cultural experience, but they are loud, the tracks are bumpy, and you won't sleep well.