Mamdani's win caps a meteoric rise from a little-known state politician to one of the nation's most visible Democrats.