You can get out by using a deku stick on the burning torch so the deku stick will lit up. Then walk with the burning deku stick towards the " torch that wasn`t burning so long ago " and lit that one up. Just keep the stick close to the torch and it wil lit up automaticly. Try to save your deku sticks by swinging your sword right after you lit up the torch because you will need them a lot.