The official rules for hobby photography of the DB (
https://www.deutschebahn.com/resour...onen-fuer-Hobbyfotografen-und-filmer-data.pdf) allow non-commercial photography on DB property legally accessible to the public without the need to ask for permission.
Apart from a ban of using artifictial light, tripods and similiar devices, the rules are pretty much common sense for railway photography (stay in public areas, don't endanger anyone, don't hinder operations or block evacuation routes and respect the privacy of other people).
It is also a very good idea to be friendly to our railway staff and to follow their instruction (the behaviour of some "enthusiasts" here has left a far too negatively skewed impression of the scene amongst some members of railway staff).
Official contact details are also provided for any questions (including requesting legal cab rides) in the document linked.
Follow the social distancing rules and properly wear a mask when required (in enclosed public spaces, aboard trains and also on platforms) and you shouldn't encounter any problems.
In fact, you are likely to do a better job than far too many people here if you do.