Captains with sea commands generally command ships of cruiser size or larger; the more senior the officer, the larger the ship, but ship commanders do not normally hold a higher rank than captain.
Commanders of naval vessels typically helm ships of cruiser size or greater; seniority corresponds to larger vessel sizes, but ship commanders usually do not hold a higher rank than captain.