If you are writing a book you can do anything wish.
In real life there would be little or nothing that could be done.
1. Unless you are covered by a Union contract or Official Company policy you can be terminated for just about any reason. Forget about "Official Company Policy". Position eliminated is the most common reason for termination. The person who takes over the position will just have a different title and slightly different job description.
2. Just because someone else takes over a position doesn't mean anything. The truth is that people end up making too much money and are expendable.
3. Innuendo, personal opinion, office gossip and rumor are worthless in a court of law.
4. If there isn't a paper trail or strong witness testimony to say that the person was terminated in order to give another person the job, in exchange for sexual favors, then you just look for a new job. Even if the subordinate had had a relationship with the boss there must be evidence of collusion that the person was terminated in order to give the subordinate the position because of the sexual relationship.
Have fun writing.