Authorities in Peru rescue 39 people from captivity, including 26 children, whom Maoist Shining Path rebels were raising as future rebel troops, the government says.