There are those here on the forum who believe that Kirk was actually a Lieutenant based on his name being "Lt Kirk" on a console, but I don't find that plausible.
Kirk could have received a brevet rank of Ensign while still at the Academy, taking his cadet cruise. Once he graduated, he was commissioned as a Lieutenant. I don't think that's a reach. And assuming that (when the hearing was unexpectedly called off to divert everyone to Vulcan) Kirk was just about to graduate - with the commendation for original thinking that he was about to receive - it does fit.
It is by caffeine alone I set my mind in motion. It is by the beans of Java that thoughts acquire speed, the hands acquire shakes, the shakes become a warning. It is by caffeine alone I set my mind in motion.