That’s the hook the councilman used. He was “on duty” when he said it.
That is not a defense. It has to be while performing legislative duties.
Judges have been successfully sued for violations of civil rights of their underlings if they were "administrative acts" rather than judicial acts.