Poland’s government says a deal has been reached to prevent the closure of the mine.