Last I looked stupid is the opposite of smart.
As you stated, those from upper castes have higher IQs.
If true, it's obvious we don't have IQs running in US families.
Therefore, it's can't be family or genetic.
It's simply environmental, and down to education and drive.