Maybe he had already passed starfleet's version of undergrad and was in their grad school, thus a commissioned officer and a "cadet" at the same time?
Maybe so, however unlikely. The writers definitely screwed up. At the beginning of the film, Pike tells Kirk "Starfleet could use you. You could be an officer in four years. You could have your own ship in eight." While unlikely that he really could make Captain in four years after becoming an officer, I'm willing to let that slide because Pike saw aptitude in Kirk. This clearly implies that Kirk would be a cadet while in the Academy, holding no rank other than Cadet. He is able to graduate in 3 years, but should still be a cadet. Presumably, this is so he can graduate at the same time as Uhura, who was already a cadet when they meet. The bar scene takes place three years prior to the main events of the movie.
Just because starfleet is based on 20th century anglo-american militaries doesn't mean it has to be absolutely the same.
I'm not using anglo-american military as my reference point, I'm using every other canon reference of Starfleet Academy in all of Star Trek. Everyone who attends the academy does so as a Cadet, and is given the rank of ensign upon graduation.
Other characters in Star Trek:
Picard graduates the Academy in 2327, and is promoted to Captain of the Stargazer in 2333 (six-seven years) from the rank of Lieutenant Commander. Presumably, this means he skipped a rank. Of course, there are similar extenuating circumstances here, given that his entire bridge crew was killed in an attack.
James Kirk (TOS) graduates the academy in 2254 with the rank of ensign. He is a lieutenant by 2255, and is Captain of the Enterprise in 2264 (ten years) at the age of 31. Not sure where the earlier claim of 8 years for TOS Kirk came from, but if my canon is incorrect then I'll revise.
Captain Scott of the USS Renegade from TNG episode
Conspiracy was the youngest officer to ever attain Captain, although its not stated how long it took her to do that. Given what we know about Picard, it must have been damn quick.