The straight answer to one question, “Has Lord Rama ever been defeated”, is yes. You will be surprised to know who he was defeated by.
So, the story goes that once Surath, the king of Kashi, visited Rama, and when going there, he only paid his obeisance to Rama but ignored the guru of kingdom Vishwamitra. As you know, in the Hindu culture, the position of a guru is higher than even gods. Rama could not bear this insult as a follower of dharma, ‘Maryada-Purushottam’. He promised his guru that he would slay Surath that evening.
It was impossible for Surath to protect himself from the wrath of Rama. Knowing this, Surath flew to the mother of Hanuman and begged her to find a way to save his life. She did not know that Rama was the one who was after him. So, she told Hanuman to protect Surath and saved him. Hanuman made a promise to his mother that he would do everything in his power to save Surath.
When Rama came to kill Surath, Hanuman realized that he had made a mistake, but then again, he had made a promise to his mother. Lord Rama tried to talk him out of it, but Hanuman would not sway. He stood there between him and Surath as a wall protection.
Rama got furious with Hanuman too. So, he shot him an arrow. Hanuman was smart, and so he started chanting “Rama.. Rama.. Rama…”. As soon as the arrow came towards him, it went back when Hanuman chanted the name. The process continued for a while: Rama shot the arrow, Hanuman prayed the chant, the arrow went back. Eventually, guru Vashishta arrived and directed King Suratha to beg for mercy from guru Vishwamitra. And thus, the battle concluded.
If you look at the entire Ramayana, then you will realize that Rama’s arrow had never failed him, except for this time. Hanuman showed how powerful chanting “Rama” can be. It is even greater than Lord Rama himself.
Source – Quora