Probably date of rank. Lots of “field promotions” in WW2 when no officers left someone is given an on the spot promotion to commissioned status. Often it boils down to every man for himself if it gets bad enough.h
Ansel12 said the date of enlistment would be the determining factor between whom gets senior command in the even that anybody senior is killed or incapacitated.
And if it’s still a tie, time in service comes next. If it’s still tied then it’s something like flip a coin or cut cards.