After mayor shuts down police comments, judge orders hearing