Be sure to carry your passport, while traveling between EU countries, either by air or train in Europe. You will never know when it will be asked. I was traveling by train, from vienna to Munich and as soon as train entered the German border, couple of guys showed their ID to me, saying they are passport control and demanded my passport for verification.  Looks like Germany has very strict passport controls. I heard similar train checks in Serbia, Netherlands, Slovakia etc..

It is always better be safe than sorry for not carrying your passport.

Even at times, when booking international train/bus tickets, and hotels  especially when checking in insist insist for your passport. They wouldnt accept any other ID like residence card etc..

You can book train tickets online with Deutsche Bahn / RailJet, but you will need to carry your credit card/passport as ID, which you will need to show to the ticket inspector.