It is unusual to have two Captains on a one ship, unless the Senior Captain has been given a specific group responsibility in which case he would adopt the title Commodore. Commodore is not a rank, just a title, although he has flag status in all but name. The officer maintains his place on the Captains list and reverts back to Captain on completion of the assigned duties