The Ulster County executive won a tight race in a swing district after putting abortion rights at the center of his campaign.