I am a retired USN, LCDR and I can tell you that whatever you know about US officer ranks no matter which branch, just forget it because it does not directly apply to the SWU, at least not when we talk rebels and resistance members. Furthermore, you also have to forget anything from the old canon. Those old West End books, Video Game ranking systems, etc... appears to have been swept away. So any confusion fans have is understandable.
For the most part, I believe this ranking system for resistance members holds up for Rebels/New Republic as well. The only difference is that the resistance ranks connected the dots. It is a combo of know Army and Navy rank names intertwined and this rank system (they did a similar thing in BSG) applies to both the Army and Navy forces with the exception of nomenclatures for General and Admiral based on the branch.
View attachment 1736075
In case you can not envision it in your head.. I added a dot to represent the pips of the older badges.
View attachment 1736078
From what I have observed, the Imperials use the rank of Captain like traditional Navy (pay grade of 06 which is the same as a Colonel ins the Army) For the Rebels, New Republic, Resistance, the rank of Captain is like that of the Army (pay grade 03 which is that of a Lieutenant in the Navy).
However, the Rebels, New Republic, Resistance do use the term of Captain as a position (as you touched on above), meaning that they have command of a ship or unit but is not necessarily the rank of that person. But it is considered proper in a military unit to address a person as Captain even if not their rank. It is hard to tell in the OT what rank Han is prior to that of General because he might be getting address as Captain Solo because he is Captain of the Falcon or if he also happens to be the rank of Captain as well.
Lastly, the SWU tends to also assign ranks a lot differently than the real military. But if you go through a few posts back, you can see a real Navy LT (Capt in the Army) who is getting a command pin afloat for a unit so there is real precedence for the junior officer like the one in Ahsoka to have command of a ship. Most likely to, as a transport, it might be considered a smaller ship, and a stepping stone to higher ranks and bigger ships. But, I think the SWU throws out General ranks like Samuel L Jackson throws out F@&%S.