Twain is making fun of superstition here........ Tom and Huck take his hat off and hang it on a limb: 'Afterward Jim said the witches bewildered him and put him in a trance, and rode him all over the state, then set him under the trees again, and hung his hat on a limb to show who done it.'" (26)
This is definitely a hyperbole. Even though Twain's intent is to satirize superstition, he adds in the gross exaggeration of Jim's trip around the state with the witches, just so they could show him who "done it." (took his hat)