The Bible often applies inductive reasoning to history. It describes real people and events (the histories), derives principles and precepts from them (Proverbs, other wisdom books, Gospels, NT letters), handles edge cases and exceptions (like Ecclesiastes and Job, where the righteous suffer and the wicked prosper). The Bible uses many of these stories as analogies to spiritual realities that cannot be discerned directly. Jesus' parables are examples of such analogies.
Such analogies have their limits. Joseph, Moses, David and others are given as types of Christ, despite their imperfections. It is in this way that a principle is built from the life of Cain. In Genesis, Cain's family is the evil line descending from Adam and Seth's line is the originally good line that is failing. The flood of Noah is a decisive judgment against both the most wicked (Cain's descendants) and the originally righteous who have begun to compromise through intermarriage and adopting the practices of the wicked.
The judgment of Noah' time is then built up in scripture as an analogy to permanent and eternal judgment in Hell. Thus in 1 John 3:12 we have:
Do not be like Cain, who belonged to the evil one and murdered his
brother. And why did he murder him? Because his own actions were evil
and his brother’s were righteous.
Cain is being used as a type of the permanently fallen person who "belongs" to the evil one, suggesting permanent slavery.
Jude says something similar, and emphasizes the permanent nature of the punishment, 'blackest darkness...forever':
11 Woe to them! They have taken the way of Cain; they have rushed for
profit into Balaam’s error; they have been destroyed in Korah’s
rebellion.
12 These people are blemishes at your love feasts, eating with you
without the slightest qualm—shepherds who feed only themselves. They
are clouds without rain, blown along by the wind; autumn trees,
without fruit and uprooted—twice dead. 13 They are wild waves of the
sea, foaming up their shame; wandering stars, for whom blackest
darkness has been reserved forever.
However, the fact that Cain is used as a type of the permanently fallen person destined for Hell, just as with the good people who were not perfect, we cannot be sure that Cain was completely evil and unredeemable, but it seems more likely than not that he did go to Hell.
(See http://faithalone.org/magazine/y2007/1sep07.html for an argument that comes to the opposite conclusion as me.)