Ships are divided in classes. Naval ranged, Naval raider and Naval melee (and carrier). The first two can attack with ranged attack, anywhere within their range, sea or land. This has nothing to do with their melee strength. Immortals have now a separate ability for a ranged attack, they can attack anything with range, land or sea.