Sisko was a commander, and he was captain of the Defiant. In the TOS years, Starbase Commanders were Flag officers. But again we see Sisko, a commander, in charge of DS9. I'm sure Starfleet has so many Captaincies slots open, so not everyone can be given the rank of Captain. Starfleet doesn't want to be to top heavy when it comes to rank. To many chiefs and not enough indians could cause some problems.