It's always possible that a slave in Missouri might not have known that
Illinois was a free state--but it would have been highly unlikely. You
might consult any of the now-classic slave narratives/autobiographies of
the American nineteenth century (Frederick Douglass, Harriet Jacobs,
even Booker T. Washington's UP FROM SLAVERY) for illustrations of how
intricate and extensive lines of communication were among slaves in the
1800s. A character in Charles Chesnutt's story "The Goophered Grapevine"
describes what he calls the "grapevine telegraph," a grass-roots
antebellum system of communication that got information to slaves long
before white Southerners received the same news.
The upshot is that nineteenth-century American slaves were surprisingly
well-informed despite widespread sociopolitical efforts to keep them
uneducated and illiterate. In other words, Jim would have had to have
known that Illinois was a free state (consider, for example, how much he
reveals that he knows about his status in the novel).
One last note on the matter of Jim escaping through Illinois: you might
also consult the edition of HUCK FINN produced by The Mark Twain
Project--one of the most respected scholarly institutions in the
country. Their volume is edited by Walter Blair (a major figure in Mark
Twain Studies since the 1930s) and Victor Fisher (who has been working
with Twain Materials at UC-Berkeley for over thirty years). Blair and
Fisher, in the minds of most academic literary critics, answer the
question of Jim and Illinois rather definitively (see, for example,
explanatory notes 54.9 and 99.2-8).
Eastern Michigan University