Yep. I took that train, Hamburg to Copenhagen, back when it still ran on the the ferry. Lots of fun!

The route actually does still run, of course, but it takes the long way around via land until the Fehmarn Belt tunnel[1] opens around 2029.

[1] https://en.wikipedia.org/wiki/Fehmarn_Belt_fixed_link