In the battle field, just before dying, Ravana discusses the reasons for his defeat with Rama. The discussion goes like this:
” Rama…. I am superior to you in almost all the aspects of life.
I am a brahmin.. you are a kshatriya
I am elder to you
my family and the forces are bigger than yours
the glory of my kingdom is higher than yours
Your antahpuram (place where the king and queen relax) is made from gold, but my entire kingdom is made from gold
I am more powerful and stronger to you
my kingdom is much bigger than yours
I have more powers and intellect than you
But in spite of being superior in all aspects, I lost in the battle.
The reason for this is very simple:
YOUR BROTHER IS WITH YOU AND MY BROTHER LEFT ME AND JOINED HANDS WITH ENEMIES”
(Valmiki Ramayana doesn’t have any mention of such discussion, this seems to be a fictitious story, but contains a profound moral).