Once you have freed all the prisoners from their cells go back above-ground to the village and talk to them as restored adults (or still a kid in one case). After a while you will be returned to the necromancer (I'm not sure of the precise trigger - if it is a certain number of conversations or one particular person to talk to again).