Mayor Zohran Mamdani of New York City returned to the State Capitol for the first time since taking office, underscoring the shifting political winds since his victory.