At a hearing, a federal judge praised Oakland police and city officials for achieving reforms and said he could release the department from oversight in September.