A judge on Monday directed the acquittal of two men accused of shooting at the police in 2017 after ruling there was insufficient evidence.