Be Direct
I don't think this situation requires a particularly careful response.
The next time your friend makes an unfunny joke about your ethnicity (while you two are alone!), simply respond with something like:
Hey, man, your Indian jokes are never funny, could you {just stop with them / work on them}*? I'm not really offended, they're just not funny to me.
If you two have a fairly close friendship and you have never communicated this, he might even appreciate your opinion, and hopefully will understand your feelings regardless.
Explain Further
If there is any awkwardness you want to dispel, or you'd like to be a bit more clear, you could pull out your phone and show him a video clip of an Indian joke that you find particularly funny. If he seems open to feedback, you could try explaining why the joke you just showed was funny, but his jokes aren't.
Using your examples:
For example, when I was eating my sandwich and he asked whether I have ghee on my sandwich instead of butter or paneer instead of cheese, while he could clearly see that it was regular cheese (it was Gouda if I recall correctly).
There may have been a potential for a stereotype joke if you were actually using ghee or paneer, especially in an otherwise normal sandwich.
And another time he asked whether I knew some random Indian person he saw on the train.
There might have been potential for a joke if you had run into an Indian person on the train and you knew him, and pointed this out to your friend, "I know this guy!"
The issue seems to be that your friend recognizes what could be a potentially funny situation (if one finds ethnicity based jokes funny), but that situation doesn't actually exist.
*: Your request to him depends on your desired outcome. Would you be okay if the jokes were actually funny and don't mind helping him improve his comedy, or would you prefer they stop outright?
**: This answer assumes that you yourself find ethnicity and race based humor to be funny when done correctly. If you do not, simply being direct, as in the first part of the answer, is enough. Your uncomfortableness is more than enough justification for your friend to stop making these jokes.