The unexpected result has shined a national light on a rare Democratic pickup opportunity and energized the party’s left flank.