Boston's trains used to run 24 hours a day — something many MBTA riders may not know.

So why don’t we have late-night service anymore? It’s a question that’s come up over and over during our reporting collaboration with Axios Boston on nightlife in the city.

“How can Boston claim to have good nightlife when the MBTA shuts down so early?” Jane in Dorchester asked us in our survey.

Marc Plageman, interviewed on a recent night out, said running trains later in the night could also make the city’s roads a bit safer.

“Way less people would be drunk driving,” he said.

The question has been vexing Bostonians for decades.

“I should say that when I was a graduate student many, many decades ago, it was the same complaint,” GBH News’ transportation reporter Bob Seay said. “Especially those of us who grew up in New York or around New York were like, what's the story with this town? They stopped the trolleys and subways at 1:00 in the morning. How are we supposed to get around?”

There's a desire for late-night, 24-hour train service. But figuring out whether that's actually possible and even why our trains aren't 24 hours in the first place is a bit more complicated.

At the tail end of the 19th century, the Boston Elevated did run 24 hours a day, said Steven Beaucher, author of “Boston in Transit,” and operator of Ward Maps and MBTA Gifts store in Cambridge.

“The Boston Elevated, at the time, they operated the largest public transit system in the world,” Beaucher said. “It's under the auspices of one company. They had a regular service through the Tremont Street subway.”

Boston was a 24-hour transit city for a long time, he said.

“Interestingly enough, we had pretty regular overnight service until the T took over in 1964,” Beaucher said. “Once the T comes on board, you really lose any regular overnight service."

But over the years, lower funding has meant less capacity for maintenance of the T. Now, maintenance crews have an overwhelming amount of repairs to tracks and trains, and often use the hours between 1 a.m. and 5 a.m. to complete them.

The MBTA did run a late-night pilot program almost a decade ago, said Mike Deehan, a reporter for Axios Boston, who has followed the MBTA’s late-night attempts. Between 2014 and 2016, the T ran a late-night train and bus pilot that cost about $2 million.

“That was supposed to be backed by private investors and private businesses who wanted to keep it going, not just the state on its own,” Deehan said. “Those businesses didn't really pony up as much. And that pilot went away after the 2015 snowstorms and kind of the realignment during the Baker administration to focus on cost-cutting instead of service expansion.”

Ridership may not be as high as needed, Deehan said, especially for something billed as a pilot program.

People ask, you know, well, why can't we bring this back? And a lot of it has to do with ridership,” Deehan said. “There wouldn't be that many. It would definitely be a cost to the T, a cost to the state. It's not going to make money.”

In the past, policy pushes for 24-hour service have focused on late-night workers: Service industry employees, health care workers on night shifts and maintenance workers who work through the late hours.

“The focus has never really been on nightlife,” Deehan said. “But look, we're in maintenance mode at the MBTA right now. We've shut down the entire Orange Line last year for a month. We're talking about sporadic shutdowns to do fixes now. To squeeze all that maintenance into the few hours a night when the T lines are shut down to begin with for regular maintenance, there's no way in hell we're going to be able to go 24/7 any time soon.”