I usually use the following site for train times:
This site covers pretty much all of the major train services. It doesn't have all the special trains, such as the InterCity services in Greece. I searched for Thessaloniki to Istanbul on that site and got quoted 26 hours, so I searched on the offical website of a Greek company and found an overnight InterCity train. But on the whole that website is very good.
And as for the YHA...I'm not sure how much use it will be, but I will be getting one before I go. It's only £10 or so, so its not too bad.