A federal judge ruled against Trump administration policies that said asylum-seekers could not base claims on domestic and gang violence.