Judge grants restraining order that prevents mandatory overtime for police