It shall be the duty of the court or magistrate before whom the cause may be tried to order as part of the judgment in such cause, that such nuisance be immediately abated and removed, and that the Chief of Police proceed to abate and remove the same.