I'm almost certain this is the case. I also think its highly likely he doesn't keep the rank of captain past the end of the movie.Or it could be they are all "acting officers". Kirk takes command of the Enterprise so he is Acting Captain, McCoy is Acting Chief Medical Officer and Scotty is Acting Chief Engineer which means both must be Acting Lt Commanders.
I'd be more likely to believe this if we didn't actually see all of these people in their real Starfleet uniforms *with the corresponding rank stripes*. We see McCoy wearing a blue uniform with LCDR stripes, Scotty in red (ditto), and there's even the "Buckle Up!" scene with Kirk in full uniform and rank.