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.