The mayor of London has stepped in to save the 47 of the 51 London Overground ticket offices that were threatened with closure late last year.

Sadiq Khan has promised to inject £5m of additional funding into the Overground system.

Not all of the ticket offices will retain their current opening hours, but the mayor’s office has confirmed they will all be open from 7.30am to 10.30am each weekday – and open longer where last year’s consultation revealed there was “customer demand over 12 transactions an hour”.

The four ticket offices not saved are Stamford Hill and Theobalds Grove, where ticket offices have been closed for some time, at Brondesbury where plans to implement step-free access will require the ticket office’s closure, and White Hart Lane – where ongoing regeneration means a decision has yet to be made.

New hours for each ticket office are yet to be announced as TfL is consulting union representatives.

Front desks at six stations in Camden get a reprieve including at West Hampstead and Gospel Oak, along with eleven throughout Hackney – notably Dalston Junction and Hackney Central.

Also saved were two in Islington, three in Brent and two in Tower Hamlets. The ticket office at Anerley station in Bromley will also survive.

Sadiq Khan said: “Proposals were being considered that would have resulted in the permanent loss of 27 ticket offices. However, having listened closely to the views of passengers and to the hard-working staff working at our stations I have asked TfL to ensure that no ticket officers will be closed permanently, and the busiest ticket offices will remain open to passengers exactly as they do now.”

General secretary of the RMT union Mick Cash welcomed the news and said: “This is a significant victory for RMT members at the front line of the London Overground service who led the campaign to stop this ticket office carnage and jacked up the political pressure to reverse the cuts.

Arthur Leathley – who chairs watchdog London Travelwatch, added: “We are pleased that the Mayor has found the money to keep 47 [ticket offices] open.

“Many London Overground passengers rely on the ticket office to buy their tickets and I am delighted that we have secured significant investment in ticketing and customer service.”

Sadiq Khan’s £5m will also be spent modernising customer service at the stations, including by trialling video-link ticket machines later this year.

Hackney’s transport chief Cllr Feryal Demirci, who campaigned against the closures, welcomed the news. She said: “It’s a victory for all travellers in and out of the borough, but overwhelmingly so for our vulnerable and disabled passengers who value the face-to-face support, assistance and comfort provided by transport staff. I would like to congratulate RMT on its campaign and thank City Hall for listening.”

Islington Council’s transport chief Cllr Claudia Webbe added: “I am pleased the mayor and TfL have listened to the concerns I raised on behalf of local people about the proposals, and will now maintain staffed ticket offices at the busiest times of the morning during the week.

“We will maintain a close watch on how these changes work in practice, to ensure that passengers, especially disabled, elderly and more vulnerable people, are not adversely affected.”