The dismissal reflects a new mayor’s push to enforce civil service rules in a department plagued by misconduct.