It is true that villains have a cold heart, but sometimes redeemed Villains decide to make the right choice if feel they like it or not
The reasons can be many. Maybe the villain...
Is the only one allowed to defeat You.
Still thinks you are his best bet against the villain he was saving you from. This can be Big Bad versus rival Big Bad, or The Dragon using you against his master for good or not-so-good reasons.
Wants to gain your goodwill in order to betray you later.
Hates the other bad guy more than the heroes.
Is just very, very hungry and doesn't care what he eats.
Is an Anti-Villain (or even Good All Along)
Wants to run the world, and the other villain wants to destroy it.
Has a plot in the works that requires the heroes' continued survival to function.
Is a bit more affectionate towards the hero than they admit.
Simply feels that losing to another villain is an unworthy end for the hero.
Has a cordial relationship with the hero or really, genuinely is the hero's friend and does not want the hero to get hurt. Or at least not unnecessarily when it's not a matter of foiling the villain's important plans.
Has good, if somewhat extreme intentions but otherwise protects those that cannot protect themselves. Luckily, they respect the hero enough to include him or her under that category.
Was done a good turn by the hero at one point such as the hero saving them from certain death, and the villain feels he owes them a favor. The rescue will probably end with the statement from the villain, "Now, we're even," and the usual antagonism resumes as before. Alternatively, the villain would genuinely treat the hero as his friend, but not the others.
Maybe it's genuinely a coincidence, an unintended consequence of an attack on a rival. In this case, the villain is probably not all that happy that he just saved the hero's hide.
Has Amnesia because of the last season's events and only remembers the Hero's name, thus decided to help him/her because he feels like it. Can be faked out of remorse.
The villain doing the rescuing simply thought it would be funny to mess with the other villains scheme, does not actually have any personal stake in the matter and of course it's always possible that it is not a rescue at all.
The villain gave the hero a Hope Spot, the relief of escaping from his enemies, it's possible for him to destroy that hope himself.
Megamind rescues Roxanne and all of Metro City from Tighten, but by that point Megamind was well on his way to completing his Heel–Face Turn.
The Lizard saves Spider-Man from falling off of a building after his Lizard-ness starts to wear off and he regains his mind.
Jason Voorhees actually pulls this off a few times in the Friday the 13th series. For one, Rennie is being attacked by two gang bangers and Jason kills them (and proceeds to try and kill her afterward) in Jason Takes Manhattan. And who could forget the scene in Freddy vs. Jason when Jason stabs Freddy with his own clawed glove as he is about to kill Lori and Will.
Neopolitan is about to execute Yang Xiao Long, but Raven Branwen teleports in and silently challenges her, and Neopolitan flees immediately.
The SA-X steps in and attacks the Omega Metroid just before it can destroy Samus Aran, although in this case the rescue was because the X parasites were the natural enemy of the Metroids, and it failed to destroy the Omega anyway, but when the X is destroyed instead it gives Samus back her Ice beam which allowed her to defeat the Omega.
Doctor Doom teams up with the Fantastic Four to defeat the Over-Mind, who had telepathically took control of Mister Fantastic.
As the X-Men lose their first fight against the Purifiers, Magneto shreds their high-tech metal suits and turns them into mummifying bonds.
Donquixote Doflamingo comes all the way from Dressrosa to Punk Hazard to rescue his subordinates after he hears nothing from Monet while on the line in the Den Den Mushi when he fails to realize Caesar Clown killed her by mistake by stabbing her heart, mistaking it for Smoker's, and eventually manages to rescue only Baby 5 and Buffalo.
Kylo Ren saves Rey from Supreme Leader Snoke by betraying and killing him.
(Dark Bowser: Still here? Has the dark power not crushed your puny hopes? Soon this kingdom will vanish along with all who dwell within. And you, too, will sleep eternally in the dark power's embrace.) GWAHAHA! Great dark hurricane! Seriously, perfect backdrop for an awesome final battle! You really sweat the details! Listen up! You're saying the kingdom will vanish? NOT TODAY! THIS KINGDOM IS ALL MINE! SO YOU VANISH!
~ Bowser saving the Mushroom Kingdom from being plunged into darkness by Dark Bowser.
STAY your hand from the Human Torch, Over-Mind. DOOM approaches!
~ Doctor Doom teaming up with the Fantastic Four to defeat the Over-Mind, who had telepathically took control of Mister Fantastic.
Sheath your claws, Wolverine. Magneto is here as a friend... and, if you'll have me, an ally.
~ Magneto after saving the X-Men by shredding the Purifiers' high-tech metal suits and turning them into mummifying bonds.
(Neopolitan pulls a hidden blade from within her umbrella and approaches the unconscious Yang. She prepares to deal the finishing blow, grinning sadistically while doing so. Suddenly, a masked warrior - raven-haired and clad in red and black - comes out of nowhere and knocks Neo back. Neo's eyes change from brown and pink to white, mirroring her fearful expression. The mysterious swordswoman slowly draws her sword again - long and crimson red - and holds it up intimidatingly. Neo, realizing the imminent threat before her, wastes no time and disappears in a flash. The swordswoman looks down at the still unconscious Yang, and slashes her sword to the side, opening an eerie red portal. She walks away from Yang and into the portal. At that moment, Yang regains some consciousness and slowly gets back up. As she opens her eyes again, she gets a brief glimpse at her rescuer before the woman disappears. Yang rubs her head, still reeling after just regaining consciousness, before standing up and leaving the scene.)
I know what I have to do. (Rey: Ben.) (Snoke laughs at this.) (Snoke: You think you can turn him? Pathetic child. I cannot be betrayed. I cannot be beaten. I see his mind; I see his every intent. Yes! I see him turning the lightsaber to strike true!) (Without him knowing, Ren uses the Force to face Anakin's lightsaber toward Snoke.) (Snoke: And now... foolish child... he ignites it... and KILLS his true enemy!) (Ren clenches a fist. Snoke's smile suddenly vanishes in an instant as his face contorts with a combination of shock and pain, the sound of a lightsaber's ignition filling the air. Rey is dropped to the floor and looks up at Snoke, who looks down at himself in horror as the camera pans backward to reveal that Ren had used the Force to ignite the lightsaber, impaling his leader through the waist! The last thing he sees is the lightsaber flying back into Rey's hand before the upper half of his body falls to the floor.)