No, upvotes most definitely do not cancel flags.
What probably happened is that a moderator evaluated your flag and decided that it was valid or reasonable, but also decided not to take any action. That's why your flag weight didn't decrease (and you didn't see the number of flags you've had rejected increase), but also why the post wasn't removed.
This is definitely an edge case, a gut call whether to delete an answer like that or leave it there. As Bobby points out, it's clearly a joke answer to a terrible question. The answerer probably doesn't deserve all the rep (s)he got for it, but it's not particularly hurting anyone to leave it there, either.
If I were the original poster (or a moderator), I'd mark the answer as "community wiki" and be done with it. We all appreciate a good joke at the expense of a bad question from time-to-time. Unfortunately, I am neither and I was not the one who made the call.
Regardless, your voting to close the question was the right move. Closing questions like this one quickly is how we prevent an onslaught of terribly useless answers, whether because they're overly speculative, or simply meant to be humorous. If the question is later improved, it can be re-opened without too much trash having accumulated.