The best-case scenario for the Continental Army would be to delay the British and inflict signficant casualties before retreating. Given the military technology of the time, New York was indefensible against an attacker with naval supremecy, since any position could be outflanked by a naval landing.
IOTL, both sides initially overestimated the effectiveness of American shore batteries. This is why the Americans attempted to defend forward positions and the British obliged by attacking them rather than just landing upstream, until British probing attacks demonstrated later in the New York campaign demonstrated that they could easily run past the guns.
If the Americans put up a better show at Long Island, the British would have risked running the guns earlier, then simply bypassed the defenses and landed in Manhattan.