Education in ancient India was for well cultured people, those who were born in Brahmin caste or khatriya caste. People were classified according to their professions. So only those of the higher society were educated and given prominent positions in the court of the kings.
In British India only those who had money could go to schools and study. Also those who could go for higher studies or those who use their studies to do jobs were educated in general. Other people generally followed their traditional professions that came to them via their families in descendence.
British also encourage those to study, who would be useful to them in their administration of India. They wanted their policies to be enforced and their superiority to be shown via their education. Generally, those who were well off financially were education. Also, the children of those who worked for the British received education.