Some preliminary thoughts: Racism seems to involve treating a group of persons who share an ethnic identity with derision, disrespect, and partial disadvantage. Accounts of racism today are controversial, but I propose that a comprehensive account of racism should involve both action as well as attitudes. What you write suggests that one reason why racism is inappropriate / unjust / wrong, is that persons cannot help being a certain ethnicity. I suggest, however, that racism would be wrong whether or not one could voluntarily adopt or abandon a race or ethnicity. If I converted to Judaism and, in the eyes of the world I became Jewish, anti-semitism would still be wrong even though I could have remained a Christian. In a related way, I suggest it would still be wrong to discriminate against homosexuals whether or not a person can choose whether to be homosexual or not.
It should be added as a side point that the very category of "race" is vexing. Some think of race as a social construct. If that is true, then (paradoxically) it could turn out that races do not exist as real things / categories, but racists do. This might be analogous to the idea that while it turns out that there are no witches (persons with supernatural powers to cast spells etc) but there have been witch-hunters.
On to intelligence: I suspect that some kinds of preferential treatment of persons based on intelligence would seem like racism. The following examples seem unjust: a policy in which only highly intelligent people have a right not to be tortured, but less intelligent people may be tortured for any reason whatever; a policy in which intelligent people can enslave those less intelligent, etceteras. But sometimes discrimination in which intelligence is a factor seems fair and prudent. Wouldn't you want intelligent persons to be pilots, surgeons, sailers, etc, rather than persons who are not intelligent --here I mean intelligent in the sense of mastering the relevant skills? Presumably, too, for a university to accept students on the basis of intelligence (including the capacity to learn) seems reasonable, right?
But you may be on to a very interesting worry. Some persons may be very vain and assume that they are superior to others on the grounds of some kind of measure of intelligence, when they are utterly inferior when it comes to matters of compassion, caring for others, generosity, courage, humility, poetic and artistic expressiveness, and so on. I suggest that someone we might call intelligent could turn out to be merely clever, but that is different from recognizing that someone is wise.