Vigilantes in a central Kenyan town took up arms against a violent gang, sparking battles in which at least 29 people were stoned and hacked to death.