Mamdani, a Democrat, was sworn in at a decommissioned subway station below City Hall just after midnight.