New York City is leading several cities and counties in challenging a Trump administration rule that would let immigration officials consider whether green card applicants are likely to depend on Medicaid, SNAP, housing aid and other public benefits.