Just before I left on this trip, there was an announcement from the German government that they would be beefing up border security and checking passports on all land arrivals.

I've entered Germany 3 times by train, from Denmark, Austria and Czechia. Not once was my passport checked. In fact the only time it was requested (except for hotel check-in) was in Syracuse (Sicily), where police were checking all arrivals by train. My passport was at the bottom of my bag and I took so long digging it out that the police got bored and waved me on.

I definitely strongly recommend carrying your passport everywhere if you visit Europe, but it seems the security measures were more chest thumping than anything else.

@the_rail_life ironically, when I took a similar journey in 2019, our train had our passports checked by the Danes when we crossed the border!
Also happened on the Barcelona-Lyon train, but nowhere else I went within Schengen (not even entering France from another direction!)

@Simbera The German conductor on our northbound train instructed us to have our passports ready for the Danish border. The Danish immigration people asked along the platform but didn't board the train.

I was surprised crossing from Denmark to Sweden that Customs (not immigration) boarded the train and walked through with a sniffer dog.