Hungary is a great country. I was very hesitant about my first trip to Hungary - I had been told in Vienna that a train on platform three was going to Budapest. The train was about to leave in less than two minutes, and so I ran and jumped on it without looking. Then, I noticed a sign in the window, saying the final destination was Belgrade! This was in 1999, when NATO was bombing Yugoslavia. Needless to say, I was a little worried. That and the fact that nobody on the train spoke English.
But - I ran into someone whom I had met on a train in Italy a few weeks before, and she assured me we would be stopping in Budapest. When you're on the train to Budapest you'll most likely run into people representing Hostelling International. They'll show you a brochure of rooms, quote you some prices and try to sell you a room. On one hand it's good, because when you arrive in Budapest they'll drive you to the hostel all taken care of. But once there you'll realize those photos must have been taken on a very good day because the rooms aren't that great. Plus, you'l find you can get rooms for cheaper elsewhere. It's up to you if you want to get a room with the HI train people or not.
Apart from Budapest though, the Hungarian train system runs through most cities and towns. The information isn't always great though - many times if a train is delayed you won't know about it, and few people outside of Budapest speak English. The train system though is quite cheap, and you can get some amazing deals for travel from Hungary to countries farther east.
Choose a country below and then pick a train station!