Yeah, it was clearly a punishment assignment.
well ok, so even if we assume that he's a Lt.(which as you write, wouldn't make sense), we still saw a rapid progression from Lt. to Captain in a matter of months. Still ridiculous, but no real way around it considering they needed him to be captain by the end, and they needed the same crew together.
And yep, it's still a ridiculously quick progression, but much easier to swallow than Cadet -> Captain.
In TNG's Conspiracy
, Captain Tryla Scott was supposedly the youngest Captain in Starfleet history, which was a legendary achievement. Kirk's rapid ascension would absolutely obliterate that record.