The "between equals" needs clarification.
In the Air Force for example, line officers (command of operational, tactical, or combat units) and non-line officers (lawyers, chaplains, civil engineers, medical, logistics, finance) have distinct chains. A non-rated officer may outrank a rated officer but will not command line operations (aircraft, missiles, etc). A rated officer may outrank a non-rated officer but the rated officer will not direct the base operations (civil engineering, base security, the hospital, finance, etc).
Within each chain, in a pool of officers who were promoted on the exact same day, those with regular commissions would outrank those with reserve commissions. This has been a disappearing distinction since 2005 when all officers who entered active duty are commissioned as regular officers and all officers with reserve commissions were transferred to regular status, but there could still be a few individuals with reserve commissions due to age requirements. (We'd see this once in a while with someone who had an extended break in service - usually medical - who returned to Active Duty).
The Judge Advocate General (JAG) and Area Defense Counsel (ADC) usually fall under a district, not a base or a wing. Their chain of command would cross different bases and even Major Commands.
Medical officers are also normally outside the chain when deployed so as to maintain the separation required for international humanitarian law.
That is a good explanation, I was going to post the simple example of medical officers not going to take over a tactical unit, but your version is much better.