I've taken the Amtrak up to Canada (not 24 hrs long though), and it was quite comfortable. The seats were amazing. I'm really tall so I'm particularly sensitive to (lack of) leg room on airplanes. And you can meet some amazing people too. One of my friends took the overnight train to San Francisco and he really liked it.
As far as taking a train abroad, your experiences may vary. If you are in Western Europe (the train capital of the world), most train rides don't take longer than a day so there is no need to sleep. They have a really good high speed network and you get places quickly. I did take a night train from Spain that went around the perimeter of France and it was horrible (about 24 hours of hell). I was too cheap to buy a sleeper train and had to sit in the seats. I couldn't sleep for a minute and I could feel the blood clotting in my legs and congealing in my toes. And the train was crowded with hooligans, druggies, floaters, and lovebirds. Nothing wrong with that at all, you just aren't going to get any sleep. Next time I would spend the money and take the TGV.
There are some trains you can take in Eastern Europe (Serbia, Romania, Bulgaria) that go overnight, but it is not because the distances are great but rather due to the lack of infrastructure. I think the novelty of riding a train in this situation would wear off greatly, especially when dealing with border guards.
If I were you I would look into taking the trans-Siberian rail from St. Petersberg to Beijing. It would be a journey through history and time. You would get to see Imperial Russia, the remote outcountry, the work of the great 5 year plan, and then end in the capital of the emerging east. That would be the most epic train ride you could ever take.