Raileurope is famous for selling tickets at inflated prices, but they have an edge because so many of us want to nail things down in advance. I was just in Budapest, and found it easy to buy train tickets for the trip to Prague while there. Our hotel sent us to the Carlson Wagons Lit travel agency (near the Intercontinental near the Danube) and about six train choices were available to us for the following day. I could have purchased at the train station, but this was far easier, and didn't seem to be any more expensive. It was about $80 per person for the one-way trip with reserved seats. A night train would require a sleeper supplement of about $20. We opted for the 6.5 hour day trip instead of the 10+ hour overnight trip - mainly because my family saw a Soviet era sleeper train in the Vienna train station, and said "no way!" I couldn't convince them that it would be a worthwhile experience :)
Kathy