I'll start with the comparison, because I think that objective is a bit harder to accomplish. Rikki is the hero, and the cobras are the "bad guys," so it's a bit tougher to show how they are alike. I would say the biggest similarity is that both Rikki and the snakes care for their respective families. Rikki obviously is ready, willing, and able to protect his human adoptive family from snakes. That's clear right from the beginning. Nagaina cares equally for her family as well. That's clear when she gives up her attempt to kill young Teddy in order to take her egg back to the protected den.

The main difference between Rikki and the snakes is in their use of violence. Both Rikki and snakes are no strangers to violence, but Rikki uses it for self defense and the defense of weaker innocents (the humans). The snakes on the other hand are malicious with their violence. It's offensive in nature, and their main motivation is to cause hurt and pain for the sake of hurt and pain. It's classic Joker vs. Batman.