India is trying to engineer advancement for its underclass through a vast and growing affirmative-action program. To decide who should benefit, officials are adapting a means of categorization long viewed by many as one of the great evils of Indian society: the Hindu caste system.