I'm not sure if Sulu was really in the chain-of-command as he was suppose to be getting his own ship originally in The Wrath of Khan and was essentially taking one last joyride on the Enterprise.
^ This. Sulu isn't technically part of the Enterprise crew in either TWOK or TSFS, but the scene which explained this was famously excised from the final cut.
I never fully understood why he's officially back at the helm in TFF though. Maybe Excelsior was still undergoing tests after the transwarp fiasco, and Kirk simply offered him another short term tour-of-duty until his own command was available again?