onlinehero's variation where the rescue attempt fails BECAUSE of the betrayal is fun because if she decided not to betray, she would have been rescued.
A possible variation is if the captured heroine gets tortured and twisted into the dark side and defeats her rescuer herself. The villains then betray her. She basically gets defeated twice, once as a heroine and once as a villain.
I think this scenario could work depending on different character dynamics (what's the relationship between the characters). It works best if the two heroines were close. Best friends, sisters. I think a master/student dynamic could be pretty interesting, with the master betraying the student.
If the heroine is too pure to succumb to such tactics (doesn't crack down under torture/rape), we could have the following situation:
Villains capture heroine AND her boyfriend
Villains rape and torture heroine for information, heroine resists and doesn't do anything
Villains bring in boyfriend to watch the brutal rape and torture
Boyfriend betrays
OR
Villains torture boyfriend
Heroine betrays