Socialists Gain Influence as Democrats Falter