It would depend on which pokemon you attack. For example, if you have a male pokemon with rivalry, and the opponents are one male and one female, you would get the boost only if you attack the male pokemon If you attacked the female pokemon, the damage would decrease. This is the same if you use surf or something like that. The male pokemon would take more damage than the female pokemon. Hope this helps!