Going by the cuff insignia. He was called "captain" because that's what you call anyone of any rank in command of a ship? I don't think the Enterprise was supposed to be the "flagship" of the Federation at first. Again, flagships are the command ships of fleets, and the Enterprise was on its own. A lieutenant commander could have commanded the Enterprise if it was initially a smaller ship. A corvette? That would allow for larger ships in the Trek-verse, like Franz Joseph's Federation Class and Diane Duane's Defender Class, without getting too fan-wanky, for some of us.