The move accelerates a generational shuffle in New York politics as allies and upstarts line up for a rare open seat in a safely Democratic district.