Not knowing what was said, it's impossible to give definitive advice. But you should also consider the possibility that some people are socially awkward (or have some 'neurodiverse' condition on the autism spectrum such that they don't understand social nuance), don't share your social rules regarding polite conversation (especially if they are themselves from a different culture), and are simply trying to start a conversation the only way they know how.
Starting a conversation with a stranger can be tricky. It's common to start with what you already know about them and ask them about that, because people usually like talking about themselves. If you know somebody collects postage stamps, or plays football, you ask them about that. If all you know is they originate from country X, and you don't realise race and nationality is an especially sensitive or dangerous subject (because in their culture, it isn't), then you might start with that. And if you don't know a lot about their culture or religion, bar the broad stereotypes in the media, then it's easy to unintentionally sound racist or prejudiced. They might be trying to say, 'As you can see I know very little about your culture, please educate me.'
You can tell the difference because if you start talking about your home and your culture, a racist will continue to argue and criticise, and insist on their view, and someone who just wants a conversation will listen attentively and encouragingly, and become more polite and friendly.
And if it turns out they are a racist, then you might also consider how your response will affect their views. If they get a friendly response, then they might consider that maybe you're not so bad after all, and maybe their prejudices are wrong. If they get a hostile response, and hounded by the authorities simply for asking a few questions, they'll consider their prejudices confirmed. They'll consider their free speech and freedom of belief to be under attack. They'll point out that you can be offensive to them by calling them a 'racist', for example, but they aren't allowed to offend you, even unintentionally. We all say things other people find offensive - 'tolerance' that only tolerates things we approve of or agree with isn't worth anything; it's meaningless. Tolerance necessarily implies tolerating views we don't like and don't agree with. We have to treat others as we expect to be treated ourselves.
That doesn't mean you have to put up with repeated and continual harassment. But if your attempts to be friendly or politely non-committal are rebuffed, and they escalate their hostile campaign, then by all means seek help to get it stopped.
If on the other hand they realised they said the wrong thing, upset you, and stopped doing it, then you could surely ask for nothing better and it was likely just an innocent mistake. There shouldn't be any need in such circumstances to take further action. Consider how you would feel if as a visitor to a foreign country, you asked an innocent question about the local culture, and someone thought you was being highly offensive (I assume calling someone a 'racist' in Germany is considered offensive...) and you got reported to the authorities for holding slanderous beliefs about them? How would you want to be treated?