In fiction, the opposite of a protagonist is an antagonist, meaning someone who opposes the protagonist.
More generally, some antonyms for “protagonist” include:
Adversary
Critic
Enemy
Foe
Opponent
Rival