LAWRENCE, Mass.—The driver on a bus circling downtown here merely tapped a button to count riders on a recent weekday morning as people streamed by the farebox without paying.

The riders weren’t doing anything wrong: the region’s transit authority in September stopped collecting money on three routes in this old industrial city north of Boston. Instead, Lawrence used $225,000 in reserves to waive fares for two years.

“These three lines go through the poorest parts of our community,” said Lawrence Mayor Dan Rivera, a Democrat, explaining the rationale for free rides. “We could support those citizens to mobilize themselves out of poverty.”

The free-ride concept is also catching on in cities like Olympia, Wash., and Kansas City, Mo. Boston and others are debating the idea. It has had limited adoption historically and marks a radical departure for transit agencies that count on fares for their budgets.

Cities are broadly rethinking bus service as they face increasing traffic and falling ridership. Competition ranging from electric scooters to ride-hailing services like Uber are driving people away from buses nationwide, according to transit officials. Subways, which don’t have to fight street congestion, have also seen ridership decline but not as much.