Mayor Zohran Mamdani began to tell lawmakers that he supported Senator Shelley Mayer to lead the State Senate, but some Democrats didn’t welcome his involvement.