The judge denied a preliminary injunction sought in a lawsuit filed by the state attorney general and mayors of Minneapolis and St. Paul.