NASHVILLE, Tenn. — A team of political activists huddled at a Hardee’s one rainy Saturday, wolfing down a breakfast of biscuits and gravy. Then they descended on Antioch, a quiet Nashville suburb, armed with iPads full of voter data and a fiery script.

The group, the local chapter for Americans for Prosperity, which is financed by the oil billionaires Charles G. and David H. Koch to advance conservative causes, fanned out and began strategically knocking on doors. Their targets: voters most likely to oppose a local plan to build light-rail trains, a traffic-easing tunnel and new bus routes.

“Do you agree that raising the sales tax to the highest rate in the nation must be stopped?” Samuel Nienow, one of the organizers, asked a startled man who answered the door at his ranch-style home in March. “Can we count on you to vote ‘no’ on the transit plan?”

Sign Up For the Morning Briefing Newsletter

In cities and counties across the country — including Little Rock, Ark.; Phoenix, Ariz.; southeast Michigan; central Utah; and here in Tennessee — the Koch brothers are fueling a fight against public transit, an offshoot of their longstanding national crusade for lower taxes and smaller government.

At the heart of their effort is a network of activists who use a sophisticated data service built by the Kochs, called i360, that helps them identify and rally voters who are inclined to their worldview. It is a particularly powerful version of the technologies used by major political parties.

In places like Nashville, Koch-financed activists are finding tremendous success.

Early polling here had suggested that the $5.4 billion transit plan would easily pass. It was backed by the city’s popular mayor and a coalition of businesses. Its supporters had outspent the opposition, and Nashville was choking on cars.

But the outcome of the May 1 ballot stunned the city: a landslide victory for the anti-transit camp, which attacked the plan as a colossal waste of taxpayers’ money.

“This is why grass roots works,” said Tori Venable, Tennessee state director for Americans for Prosperity, which made almost 42,000 phone calls and knocked on more than 6,000 doors.

Supporters of transit investments point to research that shows that they reduce traffic, spur economic development and fight global warming by reducing emissions. Americans for Prosperity counters that public transit plans waste taxpayer money on unpopular, outdated technology like trains and buses just as the world is moving toward cleaner, driverless vehicles.

Most American cities do not have the population density to support mass transit, the group says. It also asserts that transit brings unwanted gentrification to some areas, while failing to reach others altogether.

Public transit, Americans for Prosperity says, goes against the liberties that Americans hold dear. “If someone has the freedom to go where they want, do what they want,” Ms. Venable said, “they’re not going to choose public transit.”

The Kochs’ opposition to transit spending stems from their longstanding free-market, libertarian philosophy. It also dovetails with their financial interests, which benefit from automobiles and highways.

One of the mainstay companies of Koch Industries, the Kochs’ conglomerate, is a major producer of gasoline and asphalt, and also makes seatbelts, tires and other automotive parts. Even as Americans for Prosperity opposes public investment in transit, it supports spending tax money on highways and roads.

“Stopping higher taxes is their rallying cry,” said Ashley Robbins, a researcher at Virginia Tech who follows transportation funding. “But at the end of the day, fuel consumption helps them.”

David Dziok, a Koch Industries spokesman, said the company did not control the activities of Americans for Prosperity in specific states and denied that the group’s anti-transit effort was linked to the company’s interests. That notion “runs counter to everything we stand for as a company,” he said.

“Our decisions are based on what is most likely to help people improve their lives, regardless of the policy and its effect on our bottom line,” he said. Koch Industries has opposed steel tariffs, for example, even though the company owns a steel mill in Arkansas, he said.

The group’s Nashville victory followed a roller-coaster political campaign, including a sex-and-spending scandal that led to the mayor’s resignation.

But the results also demonstrate that the Kochs’ political influence has quietly made deep inroads at the local level even as the brothers have had a lower profile in Washington. (This month, Koch Industries said David Koch would step away from his political and business roles because of declining health.)

“These are outside groups,” said Nashville’s new mayor, David Briley, in an interview. “They don’t represent Nashville’s interests or values.”

A Nationwide Effort

The Nashville strategy was part of a nationwide campaign. Since 2015, Americans for Prosperity has coordinated door-to-door anti-transit canvassing campaigns for at least seven local or state-level ballots, according to a review by The New York Times. In the majority, the Kochs were on the winning side.

Americans for Prosperity and other Koch-backed groups have also opposed more than two dozen other transit-related measures — including many states’ bids to raise gas taxes to fund transit or transportation infrastructure — by organizing phone banks, running advertising campaigns, staging public forums, issuing reports and writing opinion pieces in local publications.

In Little Rock, Americans for Prosperity made more than 39,000 calls and knocked on nearly 5,000 doors to fight a proposed sales-tax increase worth $18 million to fund a bus and trolley network. In Utah, it handed out $50 gift cards at a grocery store, an amount it said represented what a proposed sales tax increase to fund transit would cost county residents per year.

“There’s nothing more effective than actually having a human conversation with someone on events that affect them on a day-to-day basis,” Akash Chougule, policy director at Americans for Prosperity, said in an interview. “It’s a great opportunity for us to activate people in their own backyards, and we’re among the first to do it in a sustained, permanent way.”

The paucity of federal funding for transit projects means that local ballots are critical in shaping how Americans travel, with decades-long repercussions for the economy and the environment. Highway funding has historically been built into state and federal budgets, but transit funding usually requires a vote to raise taxes, creating what experts call a systemic bias toward cars over trains and buses. The United States transportation sector emits more earth-warming carbon dioxide than any other part of the nation’s economy.

The Trump administration had initially raised hopes of more funding for transit by advocating a trillion-dollar infrastructure push. However, when that proposed plan was made public it reduced funding for transit-related grants.

On the Ground in Nashville

Nashville’s idea to invest in transit got off to a strong start. Introduced in October by Megan Barry, who was mayor at the time, it called for 26 miles of light rail, a bus network, and a 1.8-mile tunnel for buses and trains that would bypass the city center’s narrow streets.

The $5.4 billion proposal, the costliest transit project in Nashville’s history, was to be funded by raising the sales tax city residents pay by one percentage point, to 10.25 percent, and raising other business taxes. A coalition of Nashville businesses urged voters to endorse the spending as vital to a region projected to grow to almost 3 million people by 2040, an increase of 1 million.

“It will be far-reaching, it will serve every part of our city — north, south, east, and west — and it will help to shape our future growth and development,” said Ms. Barry, who enjoyed approval ratings near 70 percent. A poll by her team found that close to two-thirds of voters would support raising taxes to pay for transit.

The vote was set for May 1.

But then in late January Ms. Barry, who is married, acknowledged a nearly two-year affair with the former head of her security detail after a series of exposés, including reports of steamy texts, overseas trips and inappropriate spending. In March she resigned, and later pleaded guilty to theft. Ms. Barry did not respond to requests for comment.

Americans for Prosperity kicked its campaign into high gear.

Secret Weapons

The team that gathered at Hardee’s in March, two weeks after Ms. Barry’s resignation, was led by Ms. Venable and Mr. Nienow of Americans for Prosperity. Other canvassers that morning included a local Tea Party leader and a lawyer-turned-fantasy-novelist who writes about a young witch who pushes back against an authoritarian government.

Central to the work of Americans for Prosperity is i360, the Kochs’ data operation, which profiles Americans based on their voter registration information, consumer data and social media activities. The canvassers divided the neighborhoods into “walkbooks,” or clusters of several dozen homes, and broke into teams of two.

There are rules: No more than two people at a door (to avoid appearing threatening). No stepping on lawns (homeowners don’t like it). And focus strictly on the registered voter. If anyone else answers, say a polite “thanks” and move on.

“It’s the concept of opportunity cost,” said Mr. Nienow. Their data zeroed in on people thought to be anti-tax or anti-transit and likely to vote.

On a laptop in her S.U.V., Ms. Venable tracked, in real time, the progress of the four pairs working that day. By 4:30 p.m. they had knocked on 230 doors and connected with 66 people, a success rate of 29 percent. “Excellent,” she said.

“Everything we do is very scientific, very data-based, very numbers-based,” said Mr. Chougule, the Americans for Prosperity policy director. “We are able to see who are the people that are most likely to engage on this issue, who are the people most aligned with us that we need to get out, and who are the people whose minds we can change.”

Another weapon in the Koch arsenal is Randal O’Toole, a transit expert at the Cato Institute, a libertarian think tank in Washington that Charles Koch helped found in the 1970s. Declaring transit “dead” and streetcars “a scam,” he has become a go-to expert for anti-transit groups. Crisscrossing the country, he speaks at local events and writes opinion pieces.

At a forum in Nashville in January hosted by a conservative radio host, Mr. O’Toole gave an impassioned speech. “I think of light rail as the diamond-encrusted Rolex watch of transit. It’s something that doesn’t do as much as a real watch can do. It costs a lot more. And it serves solely to serve the ego of the people who are buying it,” he said, meaning city officials.

Public transit critics have long raised fears that rail projects are a conduit for crime, and Mr. O’Toole himself has made that argument: “Teenagers swarm onto San Francisco BART trains to rob passengers,” he warned in a blog post last year. But in Nashville, Mr. O’Toole made a different argument, namely that transit is for hipster millennials and would be a conduit for gentrification, forcing people to move further away to find affordable housing.

In another line of attack, he also argues that ride-hailing services like Uber and Lyft are the future of transportation, not buses and trains. “Why would anybody ride transit when they can get a ride at their door within a minute that will drop them off at the door where they want to go?” he said in an interview.

Asked whether low-income people could afford to use Uber instead of a bus, he said that subsidizing their rides would still be more cost-effective.

Raj Rajkumar, director of Carnegie Mellon University’s Mobility21 research center, which focuses on transportation issues, said studies have shown that mass transit reduces congestion and pollution. But he also said there is some truth in concerns that transit could bring gentrification. To offset that, he said, transit plans should be paired with measures to increase affordable housing.

Still, in most places and over the long run, buses and trains are the most effective and cleanest way of moving large numbers of people large distances, he said. Ride-sharing can help people on shorter trips, Mr. Rajkumar said, or getting to and from a train station. “But if you’re going 30 miles, Uber is less suitable. I don’t think Uber and Lyft can really replace public transit,” he said.

A Money Trail, Undisclosed

The scale of the Kochs’ anti-transit spending is difficult to gauge at the local level, because campaign finance disclosure standards vary among municipalities. But at the state and national level, the picture gets clearer.

Last year Americans for Prosperity spent $711,000 on lobbying for various issues, a near 1,000-fold increase since 2011, when it spent $856. Overall, the group has spent almost $4 million on state-level lobbying the past seven years, according to disclosures compiled by the National Institute on Money in State Politics, a nonpartisan nonprofit that tracks political spending.

Broadly speaking, Americans for Prosperity campaigns against big government, but many of its initiatives target public transit. In Indiana, it marshaled opposition to a 2017 Republican gas-tax plan meant to raise roughly a billion dollars to invest in local buses and other projects. In New Jersey, the group ran an ad against a proposed gas-tax increase in 2016 that showed a father giving away his baby’s milk bottle, and also Sparky the family dog, to pay for transit improvements among other things. “Save Sparky,” the ad implores.

In Nashville, Americans for Prosperity played a major role: organizing door-to-door canvassing teams using iPads running the i360 software. Those in-kind contributions can be difficult to measure. According to A.F.P.’s campaign finance disclosure, the group made only one contribution, of $4,744, to the campaign for “canvassing expenses.”

Instead, a local group, NoTax4Tracks, led the Nashville fund-raising. Nearly three-quarters of the $1.1 million it raised came from a single nonprofit, Nashville Smart Inc., which is not required to disclose donors. The rest of the contributions to NoTax4Tracks came from wealthy local donors, including a local auto dealer.

Both NoTax4Tracks and Nashville Smart declined to fully disclose their funding.

‘I Knew We Were Going to Win’

After Ms. Barry’s resignation, Nashville’s pro-transit movement struggled. Its messaging became muddled, strategists said, with supporters claiming that the plan would do everything: create jobs, benefit the environment and even boost the health and wellness of residents.

Ultimately, the pro-transit camp failed to fend off criticism that the plan benefited a gentrifying downtown at the expense of more distant lower-income and minority areas.

“If everyone’s going to pay for it, everyone needs to benefit,” said Rev. Jeff Obafemi Carr, who threw his support behind the opposition campaign and mobilized African-American voters.

After the vote, the Americans for Prosperity crew celebrated its victory at the Nashville Palace, a country music venue. “I knew we were going to win,” Ms. Venable said. “But I wasn’t taking my foot off the gas for a second.”