I have no idea how one- or a society - should go about trying to cure such horendous capabilities. However, it is well documented that immature brains simply are not capable of processing consequences of even benign acts. The notion that a society should then execute a child who has committed such incomprensibly bad acts is a strange one, to say the least.
It is why a person of sub-normal capacity is not judged on the same basis as a normal adult.