Normally even on the biggest ship of the line there should be a Captain and the admiral is there also but his command is not the ship but the fleet if present!. Captains is the commander of the ship and only his seniority in command if there is more than one present on board can decide how command. There are also squadron admirals and the rear admiral could be one of them but this is not always this way. And yes a crew member needs a certain grade per exams or seniority to command a certain class of ship or boat some stay stuck at allow grade because they cannot pass the exams to the next grade or other do not have the years to get the grade they deserve. But this is the real world in the British navy in the French navy it depens the period before the revolution or after (shortly or longer after) in the USA in it also a question of the USA being at war or not.
I hope this helps. A.