Take this example sentence:
The red team outpaced the blue team, which motivated them to redouble their efforts.
If I use "them", it seems reasonable with the context that I am referring to the blue team. However, one might also think that I am refering maybe to the red team (why not?). Plus, I think that there is a rule that says that when in doubt, pronouns refer to the subject (the red team) and not the object (the blue team).
One solution would be to specify the team again instead of using "them":
The red team outpaced the blue team, which motivated the blue team to redouble their efforts.
However, I feel that using twice the same words (the blue team) is not elegant writing.
What should one do in these cases? Thank you.