Oh. Oh my. This is a pretty difficult situation for everyone involved.
Let's not sugar-coat it more than we must: you made some profoundly poor decisions in play. For your own benefit, you really need to figure out how that happened. Why did you feel like sexual coercion was a reasonably obstacle to throw in front of the group trying to fulfill their mission? What led you to decide that the gang-rape of a protagonist was a natural thing to introduce into the game? Why did you only realize it was a bad idea after the fact?
However, it's good that you noticed your friend was unhappy and decided to do something about it. That's the foundation of good communication in play. Maybe you can salvage things.
Tools for working it out
So, generally when I've screwed up majorly in an RPG, the most productive thing is to talk about it openly and pick a fix together. Actually once we just went back and replayed a bit of the game ("retconned" it, if you will) because the ending to a session kinda flopped and we decided it'd be cooler to just do it differently, and it resulted in what was probably the best session I've ever played. This kind of editing is pretty rare in RPG culture but it's actually pretty easy.
That said, your friends might want to just put it in the past and not talk about it. That's a perfectly legit way of dealing with something that's actively uncomfortable. So don't try to force the issue (you might mean well, but if you end up creating the impression that you think someone is fragile or incapable of making their own decisions, that can be more off-putting and uncomfortable than the fictional sexual assault itself). Say that you feel like you made a mistake, and that you'd like to talk about X or Y if they're open to it, and leave it at that.
Whatever you do, don't put her on the spot to "forgive" you, and don't make a big show of your contrition and how much you've learned, &c., &c. — that's all just peer-pressure and posturing. Fess up, honestly, and take a hard look at the decisions that brought you there.
I think the best thing you can do is to create the structure that'll keep the group on the same page from here on out. I'd start with techniques like lines and veils or X-card. These'll give you some ways to talk about emotional safety and fun at the table in a clear and communicative but non-judgemental way.
If you'd like more discussion on how to handle boundaries and extreme content, I recommend the short supplement "Safe Hearts" (revised free PDF) by Monsterhearts author Avery Alder.
Fictional rape may hint at other, subtler problems
There are some issues about sexual violence in particular that I want to draw to your attention. Basically, sometimes fictional rape is just the tip of an iceberg of complicated (and probably undesirable) stuff to watch out for, because of the atmosphere that it creates. This isn't necessarily stuff you need to tackle all at once in one big block, but it's good to keep an eye on what you're doing so you can catch yourself if you accidentally slip into some unfortunate tropes about gender and violence in play.
Some examples to consider:
A lot of fiction sorta dances around the issue by threatening characters with rape but always narrowly avoiding it through some contrivance. Playing that can be just as threatening and off-putting as rape.
Is the threat of sexual violence represented as an inherent and inescapable part of being a woman? That can create a really hostile atmosphere, potentially more so than depicting rape itself, because essentially it's saying that being an object and a victim is an inseparable part of being a woman.
Is it only women who face danger in this way? That's actually a sexist trope, embedded deeply into a lot of media because Western culture is generally more comfortable with the idea of women as victims than with the idea of victimized men. (Which doesn't stop men from experiencing sexual violence in reality, in both modern society and the historical past; it just makes it very hard to talk about it coherently.)
Is being raped totally going to define the character going forward? (Hell, is it totally going to define the player's relationship with the group going forward?) Either as the thing that we constantly talk about or the thing that's always hanging over us that we tiptoe around? That's a problematic attitude about women and rape, too.
When you're playing "grim-and-gritty," there's a lot of stuff you should discuss up front. I know torture, egregious violence, ridiculous misogyny, and rape are rather de rigueur in a lot of the inspirational material, but, trust me, they're really not an essential part of creating the mood.
Also ask yourselves whether you actually have something interesting and important you want to do with this stuff: abuse for abuse's sake, as set-dressing and background color, can become grating very quickly.
The only real thing you can do is talk to your DM. Explain to him why you dislike his way of playing. The only way to get him to change this behavior is to talk to him AND show him a better way. I know this probably isn't the answer you're looking for but sadly it's the only thing you can do.
Furthermore, realise that DMing without railroading tends to be difficult even for experienced DMs. A lot of DMs don't like to see all their preperation go to waste because players went in a totally different direction than the DM anticipated. An experienced DM can usually better predict what players are going to do and are better at thinking on the fly. If he is inexperienced, give him tips, tell him what he did well and what he could have done better.
Another thing you could try is DMing a few sessions yourself in which said DM will be a player. If anything you'll get to understand each other better.
Lastly, just in case it is relevant. If you're playing a prewritten campaign, your DM might have issues with unanticipated results because the module will probably not instruct him on how to react. If that's the case, he just has an extra incentive to railroad you.
Best Answer
An interesting villain has:
Rob Donoghue wrote an excellent series on this topic: Helping Players Hate the Villain; Hate the Villain, not the GM; and The Villain's Monologue.