Your idea is a less extreme version of the death penalty, so it's highly unlikely it's going to work
My idea is far more extreme than the death penalty. The death penalty only sterilizes the rapist. My idea is to not only sterilize him, but the entire populations from which rapists emerge.
I would sterilize the rapist obviously, thus removing his genes from the genepool. His relatives share many of his genes, which is why I would sterilize his siblings, nieces, and nephews. Then I also sterilize the women who are attracted to rapists or who tolerate rapists.
If rapists are no longer born then rape will no longer occur.
There is simply no fear-based solution that has ever caused someone to observe a law that they wouldn't already have observed. The only way to stop rape is for women to treat their children with dignity and respect, i.e. as human beings, instead of beating them (esp. the boys much more often than the girls hint hint power struggle hint hint rape is an act of dominance hint hint) and treating them like they're inferior. Until this happens, rape will continue all over the world.
You are suffering from a common misconception. Rape is not about dominance, it is about sex, and sex is about procreation. This is the reason that 94% of female rape victims are age 29 or younger. Rape is simply forced mating, a common act among many nonhuman animals and some sort of humans. The reason that it is common is because it provides its practitioners with an evolutionary advantage. Turn that advantage into a disadvantage and evolution will sort things out.
Also you seem to believe that people can be taught to have different personalities. There is absolutely no evidence for this, and plenty of evidence to the contrary. Rapists are born, not trained. Other than eliminating them, the only alternative is suppressing them through intimidation.