It could work if smart people from lower casts were moved to higher casts and stupid people from higher casts were moved to lower casts. Ideally children would have to be cast-less and then at some age (before reproductive age) were promoted to one of the casts according to some intellectual test. And breeding would be allowed only between species of the same cast.
If I'm not mistaken, Indian casts do not work this way, so I don't think that it's possible to select anything.
I'm not even sure that intellect is affected by genes.
Of course this is all eugenics and considered inappropriate even to discuss in west.