Last time I traveled with DB/DSB (DeutscheBahn - German Trains) by train between these two cities there were groups of people who did not have passports and created a lot of problems in both directions both in first class and second class in the train. Can someone tell me what the situation is now?
I am guessing that you traveled with Deutsche Bahn on this train in 2015.
We can gather from various news reports that while the refugee crisis is not over, the situation has started to improve - I feel it is unlikely that you would have problems described on the question on a particularly big scale.
If we were to suddenly hear of the situation worsening, you might want to re-assess the situation, but you will probably be fine in present times