The party secured key victories in New York City, but battles across the state suggest a larger fight awaits in the fall.