Why is it that in Mass Effect 1 Shepard is referred to as Andersons XO, but in Mass Effect 3 A captain is outranked by a commander. Example: Bailey is promoted from captain to commander. And in a later quest on the Citadel Shepard who is a commander talks a captain out of killing someone by reminding him that Shepard outranks him.
Maybe because:
1. He's a spectre he outranks anyone
2. He has diplomatic authority in the game