I'm assuming Starfleet uses US Navy/Coast Guard officer ranks, so here they are with Army, Air Force, Marine Corp equivalents:
Ensign = Second Lieutenant
Lt. Junior Grade = First Lieutenant
Lieutenant = Captain
Lieutenant Commander = Major
Commander = Lieutenant Colonel
Captain = Colonel
Rear Admiral Lower Half = Brigadier General
Rear Admiral Upper Half = Major General
Vice Admiral = Lieutenant General
Admiral = General
Fleet Admiral = General of the Army, General of the Air Force ( used only in wartime and no Marine Corp equivalent)
Starfleet has the rank of Commodore- above a Captain but below a Rear Admiral Lower Half. The US Navy discontinued the rank of Commodore but I think uses the title for senior captains who commands a task force, squadrons, special ops, etc.
I served in the military and get irritated when the movies and tv can't get the ranks right, Reed was a Lieutenant but he outranked Major Hayes?!? Malcolm should've been a Lieutenant Commander equivalent in rank to Major Hayes BUT his "seniority" would make him higher in the chain of command or something to that affect. Gene Roddenberry served in WW2 and some of the sixties era writers and actors did time in the service due to WW2, Korea and the draft so TOS didn't mess up the rank structure. In the TNG, Deep Space 9, Voyager, Enterprise Era of Trek, I'm guessing that neither Rick Berman or Brannon Braga- or any other writer, showrunner, etc- did time in the military, so they didn't know or care about keeping the ranks accurate.