Following prolonged protests and a mass resignation of hundreds of doctors in residents, the deal struck reduces work shifts from 26 to 18 hours in all hospitals by 2025; ‘We won,’ says labor representative