Hi, a few tips based upon my experience
The train takes about 8 hours and it is a classic "Indian Experience". It is quite dirty, goes fairly slow, airconditioning comes from the open windows, the seats are in what they laughingly call public sleeper format - you would really not want to sleep in them. There are really young child beggars crawling around on the floor beneath the seats - you will often see a grubby hand appear next to your legs. And there are ladyboys prowling. If you fall asleep and awaken to feel something/someone stroking your face, it's scary!
Positives? This is a truly GREAT train journey, after adding three engines to get the necessary push, it zigzags up the mountain crossing the Dudshager Falls and then heads into Karnataka. There IS food and tea served to your seat on the train. It costs very little and it is really tasty and I enjoyed it and I did not die! The views from the train are great. And if you do actually like India, bad and good, (I do) then you will have fun with it and never forget it.
Most folk stay in hotels in Hospet near Hampi. I understand there are a couple of really decent ones now. I was unlucky. Avoid, avoid avoid, staying at the Hotel Priyadarshini unless you are studying the behaviour of giant cockroaches en masse, and you like the contrast of grey/white with small red brown bloodstains on your bedsheets. (My review is on TA - with photographs)
Hampi is wonderful beyond description. Literally hundreds of temples, huge and tiny, scattered across a weird boulder strewn landscape. The amazing pink light at sunrise is something that will live with you forever.
I took hundreds of photographs, if you want to see some, or some short video of the train journey PM me please. But go. Go before tourism ruins it.
Hampi in my opinion, compares with the Pyramids for sheer stunning, breathtaking beauty.