What should I do if the interviewer is not more knowledgeable than me, but rejects me saying I am not strong in certain subjects?
There are two options here:
Check your ego
Consider the possibility that you are not as strong as you think. The interviewer might be right.
Consider that you didn't explain what you knew better than interviewer well enough - what good is more knowledge if you are not able to convey it?
Be happy you dodged a bullet
Would you really want to work for someone who is less knowledgeable and does not want to acknowledge it? You might be right.
In addition: During Interview
If you question is about how to handle it in the middle of the interview, definitely work on your communication skills. You don't want to tell someone they are wrong, or not knowledgeable, but if you feel they don't understand what you are talking about, try to go back a bit and explain why your answers are the way they are, show your knowledge as an opportunity to share, rather than to triumph.
Ask - POLITELY - for clarification once: did you answer some things incorrectly, or not completely? If they say "not completely" ask if they would be open to further discussions, so that you might better demonstrate what you do know.
But if they do not respond, or say that they don't want to discuss it further - RESPECT THAT. Say "thank you for your time", and move on.
(It is possible for interviewers to be less knowledgeable about a certain skill, than the person they interview. However, it is also possible that even if they lack tech savvy, they know how to evaluate your fit for a given position/situation/team's needs. No one gets points for insisting that they're the smartest mammal in the room.)