Kirk and Uhura: They are cadet/officers like Saavik in Wrath of Khan.
McCoy: He's a Doctor so he gets to be Lt Commander.
Sulu and Chekov: Might have graduated with the previous class. Chekov is a progidy so he went through the academy even quicker than Kirk.
Normally Kirk would probably be slotted in as a navigator or helmsman
Chekov is command track and Uhura is Services/Engineering. So Chevok is in the chain of command and Uhura isn't. Her rank isn't a factor.