A magnitude-5.9 earthquake struck a remote region of southwestern China, reportedly killing at least two people and causing a stampede at a primary school.