Interestingly, unlike our wet navy, all Starfleet ships seem to have captains in charge, even those with crews in the dozens instead of hundreds. Sisko has about 300 Starfleet officers under him; some ship captains have far fewer. A more sensible solution would have been for the smaller ships to have commanders or even lieutenant commanders in charge.
Yes, it makes no sense that the captain of a tiny ship would have the same grade as the captain of a Galaxy class. Earth navies have been using lower grades for the captains of small ships since at least the 1700s, maybe earlier, despite all of them being address as "captain". I can only speculate that many TV writers and copy editors are unaware of Earth navy practice in this post-mandatory military service age.