To defeat the Malchia, lure him under one of the two spike gates and release them right when he is slithering under it. Repeat this on the other side of the room. After that, lure him into the center cage, quickly jump out, run to where Malchia started from, and roll the lever. This will cause the large spikes on the ceiling to come grinding down on top of him.