Nithya Raman has won the Los Angeles mayoral race, giving Democratic Socialists their second major victory within a year.