It was inevitable, at the moment he met <PERSON>
<PERSON>-<PERSON> was not going win that lightsaber duel.
<PERSON>: When I left you, I but the learner; now I am the master.
<PERSON><PERSON><PERSON>: Only a master of evil, <PERSON>.
<PERSON>: Your powers are weak old man.
<PERSON><PERSON><PERSON>: You can't win. If you strike me down, I shall be more powerful than you can possibly imagine.
<PERSON> was the Chosen One, trained by a Sith Lord. He was incredibly powerful. <PERSON> doesn't disagree with <PERSON>; he just knows that he doesn't have to win the battle to win the war.
It was inevitable, at the moment they arrived at the Death Star
<PERSON>: I sense something...a presence I haven't felt since...
...
<PERSON>: <PERSON> is here. The Force is with him.
<PERSON>: If you're right, he must not be allowed to escape.
<PERSON>: Escape is not his plan. 605
I must face him alone.
<PERSON> separated himself from the others because he knew what would happen.
It was tactically necessary, at the moment he saw the Millennium Falcon
If <PERSON>-<PERSON> retreated to the ship with the most powerful Dark Jedi in the galaxy in tow, it would have all but doomed the mission.
If <PERSON>-<PERSON> stayed and resisted as long as possible, it would have meant <PERSON>'s death. Only once <PERSON>-<PERSON> died, did <PERSON> retreat to the ship.
<PERSON>: Only a fully trained Jedi knight with the Force as his ally will conquer <PERSON> and his emperor.
Without <PERSON> (or <PERSON>...), there would be no hope of winning against the Empire. <PERSON> had dedicated his life to watching, safeguarding, and training <PERSON>; he wasn't about to renege.
Trap, or not
Even if <PERSON> somehow knew of the trap for the Rebels, it wouldn't have changed anything. The Jedi were the only real threat to <PERSON> and the Emperor. If <PERSON> escaped on the Falcon, <PERSON> may have decided to remove the larger threat, and save the Rebel base for later.
It was best
As good a training record as <PERSON>-wan had (or not), <PERSON> was going to be the better teacher. Whether <PERSON>-<PERSON> was alive or not, <PERSON> would have traveled to Dagobah and be taught by <PERSON>.
But as a "powerful" omnipresent Force ghost, <PERSON> could guide him wherever he was. 605