So yes, it is possible for a young Lieutenant made acting First Officer by a Captain, and later acting Captain (after relieving a former first officer who wasn't up to the task) to be left in command.
Possible for a *lieutenant*, yes. But not for a bloody cadet.
Well- Kirk was an academy graduate, which means he WAS a Lt.
He just wasn't assigned a ship, because the bureaucrats didn't like him.
So he was a Lieutenant who skipped 2 grades (full Lt and Lt Cmdr).
And again, such things were much more common in the navies of old, which is what Trek is closer to.