Chapters XVII and XVIII exemplify Twain's satire of the sentimentality of Victorian literature with its melancholy in the character of the deceased Emmeline Grangerford who has written maudlin poetry about the deceased Grangerford relatives. Also, Twain satirizes the romantic conceits of poetry with the excessive emotion of her poetry as well as the feud of the Grangerfords with the Sheppardsons.
In addition to his satire of literature, Twain's descriptions of Colonel Grangerford with his aristocratic features and manners point to the incongruity of the Southern gentry who act more foolishly than most other characters in the novel. Their polite manners are also in contrast to their having over a hundred slaves. Evidently, the slaves are not treated too well as when Jim gives them ten cents each for returning the raft, they are elated. They also fear "git a hid'n for" taking the raft.
Further, the contrast between Jim's life on the raft with Huck is much better than that of the slaves on land who go out to the field for long days, or, like Buck's slave, run constantly for their owner. Even Huck is relieved to return to the raft away from the foolishness of the Grangerfords.
I do not think that Twain really has much to say about racism in his description of the Grangerford family. It is certainly not one of the major themes of that part of the book. All that I can say is that the Grangerfords have slaves and treat them about like you would think slaves got treated.
For example, when Huck first gets to the Grangerford home, the woman named Betsy is up with the family as they try to be sure Huck is not a danger. They speak very unkindly to her (calling her a fool) and they make her get the food for Huck.
As a second example, each member of the family has their own personal slave. Huck says that his slave doesn't have much to do but that Buck keeps his "jumping" -- makes him do lots of stuff for him.
Finally, the slaves clearly get beaten at times. We know this because Jim tells them that the raft they have found belongs to him and Huck. He tells them that they'll be beaten if they take a white person's property. The slaves agree that this will happen and they give the raft back (although Jim does pay them).
So the basic idea is that the Grangerfords have slaves and treat them the way you expect. They do not seem any more or less racist than other people of that time and place.