First of all, "Mandarin" is spoken not only in China mainland, but also the standard in Singapore and Taiwan. It was a creation by the Republic of China (which later became Taiwan government) back in 1923, long before the current Chinese government came into power.
Children use Mandarin in school because they have to learn it to be able to communicate with people coming from other parts of China, which would have become a huge disadvantage to themselves. (I can't imagine how I would communicate with other people in college otherwise) It doesn't mean people will forget how to speak their own dialect. In fact, people from the same region almost always speak their own dialects.
Regional / minority cultures are generally protected by the government. The minority are almost always over-represented in all kinds of national events. Being a minority in China means you can get tons of advantage (lower score required to enter good colleges, financial aid, etc.)