Battle over sanctuary cities could end up in court