Hours after voters here adopted the first hydraulic-fracturing ban in Texas, an energy-industry group filed a court challenge contending that the measure violates the state constitution. But in the city’s coffee shops and meeting places, many residents continued to express support for the ban on fracking, which backers said was necessary to halt industrial activities in residential neighborhoods. The ban was approved 59%-41%, passing even in some precincts where residents voted overwhelmingly for Republican candidates on the state and local level. Similar bans were adopted in an Ohio town and two counties in California, but were rejected by voters in Santa Barbara County, Calif., which has a long history of oil and gas activity.