You mean something like Brendan and May, right?
If so, name two switches s:$player.isMale? and s:$player.isFemale? (turning both into script switches), and have any events that should be the rival have two pages with each one having one of the switches you just named as its condition.. Alternatively, you can store the player's character selection in a game variable when they decide, and have your rival event check for this to determine its appearance (e.g. on page with 0 or more, make them the male rival, but with 1 or more, make them the female rival). The second option works with any number of player characters, so it might be the better option, but which you pick is up to you.
You'll want to put this in the event that actually shows the rival itself, even if the cutscene where the rival shows up uses a controller event that actually houses the cutscene code (in there you can simply use a Conditional Branch with similar conditions to the event pages to change the text and which rival battle you face and whatnot, but rivals who pick a starter based on the player's already do this so that's more natural to do anyway).