Four officers had to run for their lives when dog ran at them aggressively, judge hears before ruling on case