Even if we accept that Starfleet's ranks are the same as modern-day naval ones (plausible assuming Starfleet has evolved from the present-day US Navy),
Actually, Starfleet appears to be more of a hybrid as it has Ensigns (characteristic of the USN), but it also -- apart from a short period during the 2350s and 2360s -- appoints it's most junior Flag Officers to the rank of Commodore (per Commonwealth practice) rather than Rear Admiral Lower Half (as per USN) or Flotilla Admiral (common non-Anglophone practice).
it is highly unlikely that the rank system of the Bajoran militia would correspond neatly to the army ranks (including all the sub-gradations of first, second, senior, junior, vice, chief, etc)
Likewise, based on
primary canon, the Bajoran Militia is also something of a hybrid as the
known ranks below the senior ranks are Ensign, Lieutenant and Major. There
may be two grades of lieutenant as two different shapes of insignia have been seen (a mirrored version of the ensign pin and a smaller one that only the inner/lower and middle parts of the major's in). A captain's pin
was apparently produced, but as this was never specifically stated in dialogue then we don't have to accept it. Similarly, there is costuming evidence for at least two if not three different ranks of colonel (differences between Day Kannu and Kira Nerys' pins
could be an error but Lenaris Holem's insignia has a obvious rim around the badge so it's certainly a different one).
On balance, given that the BM rank system probably
originated from the need to establish chain-of-command to interface with Starfleet (the Resistance had a much looser system), then it's reasonable to assume that they have the same
number of officer ranks as Starfleet, even if they sometimes use different names for them. Therefore:
O1 = Ensign (UFPS), Ensign (BM).
O2 = Lieutenant JG (UFPS), "Junior" Lieutenant/Second Lieutenant (BM).
O3 = Lieutenant (UFPS), "Senior" Lieutenant/First Lieutenant (BM).
O4 = Lieutenant Commander (UFPS), Major (BM).
O5 = Commander (UFPS), "Junior" Colonel/Lieutenant Colonel/Field Colonel (BM)
O6 = Captain (UFPS), "Senior" Colonel/Bajoran Colonel (BM)