The MTA is adding trains to six subway lines as the agency grapples with declining and shifting ridership.

The boost will come to the 2, 3, 7, N, W and Q beginning next spring in a bid to increase those numbers on nights and weekends, when the MTA believes there is an unmet demand due to changes in ridership patterns.

The 7 line will get the biggest service enhancement — four new round-trip trains will run on Saturdays between 6 and 8 p.m. and another eight will be added on Sundays between 4 and 8 p.m.

Other additions include two extra 2 train trips on weeknights between 9 and 11 p.m.; an additional weeknight 3 train trip; and additions to the N, W and Q lines throughout weekdays, at peak, midday and evening hours.

Transportation advocates said the additions, which will cost the MTA $5 million annually, can only help the system.

“When it comes to transit service every little bit matters and every train added matters to the thousands of people who will benefit from it,” said John Raskin, executive director of Riders Alliance.

Commuters continue to flee unreliable subway and bus service even as the city experiences a rise in population and job growth, according to agency documents presented to the MTA board Monday. Average weekday subway ridership dropped 1.8 percent, from 5.817 million in September of last year to 5.712 million in 2017.

Above ground, the decline has been steeper and over a longer period of time. Local buses experienced a 6.8 percent drop in ridership, from 2.087 million to 1.946 million when comparing the two months.

At the same time, New York City added 48,900 new jobs and employment increased 1.1 percent.

MTA officials believe a drop in student ridership and the growing prevalence of ride-hail apps has played a role in the declines systemwide.

Transportation advocates argue that decreasing ridership is directly tied to the growing unreliability of buses stuck in traffic and trains delayed by failing infrastructure — the product of a variety of maladies, including misplaced priorities and underinvestment.

“I think the ridership data is just another point of evidence that we have a transit system in crisis,” Raskin said. “Task number one for Gov. Cuomo in the new year should be reversing the decline of New York City’s transit system so that the system is good enough to attract riders back.”

Under direction from MTA chairman Joe Lhota, the state-managed agency has begun work on an $836 million Subway Action Plan to address issues that typically cause train delays, including signal malfunctions, track debris and train car breakdowns. Lhota has called on both the governor and Mayor Bill de Blasio to split the bill, but the mayor has declined.

The two have their own ideas for funding the subway in the long term. The mayor has proposed a millionaires tax on wealthy residents while Cuomo’s office said the governor would outline a congestion pricing plan for the city this January — a plan called FIX NYC.

“At roughly 5.7 million rides a day, New York City subway ridership is still near historic highs — and we are stabilizing the system through the Subway Action Plan so riders have the reliability they deserve,” said MTA spokesman Jon Weinstein. “We’re also intensely interested in drawing riders back to buses which we believe starts with tackling the scourge of congestion on New York City’s streets — and we would welcome real partnership in this endeavor.”