How to react to a student proselytising during office hours?
You address this by stating directly
"I would prefer not to discuss this topic during office hours. Can I help you with any questions you have on the homework?"
If the issue persists, I would speak with the professor and perhaps also your dean of students (or something similar).
and was visibly disappointed when I replied negatively
This is their problem, not yours.
How should I react to a question such as this?
If you feel uncomfortable defending your position when it comes to religion, politics or sex, or simply you don't want to discuss them with an extraneous person, recall that you don't have any obligation to: cut it short and answer that you're there to just answer questions about the subject you TA.
I don't want to be put in a similar situation again.
If that is indeed your main motivation, the best thing to do is to politely refuse to discuss the topic with the student, as suggested in @Vladhagen’s answer.
More generally speaking, how do I react to a situation in which I have to answer a question in a way that I know is likely to upset a student, without lying or making the situation worse?
Although Vladhagen’s suggested approach seems the best suited to avoid confrontation and minimize the extent to which the student may get upset without lying to them, I think it’s worth examining your premise that telling students things that may upset them (particularly in the current context) is something that necessarily needs to be avoided. Consider the fact that for many students, college is the first place where they start encountering many people whose cultural backgrounds and beliefs differ significantly from their own. So, “making the student upset” by showing them that there are interesting, intelligent people out there with beliefs different from theirs may actually be doing them a big favor. You are not making them upset, you are helping them grow up.
Moreover, a truthful answer promotes the general value of truth-telling, which is always a good thing. So, unless you have reason to fear that the student genuinely “can’t handle the truth”, answering truthfully seems to me like the course of action that leads to the best outcome for society, although it is a bit more unpleasant for you personally.