I think the confusion here lies in the extent of the gospel call. That is, do Calvinists believe that all people are called to repent, or only the elect?
A defining position of Calvinism is that all are called to repent. As Charles Hodge writes:
This call is universal in the sense that it is addressed to all men indiscriminately to whom the gospel is sent. [...] It is made to the Jew and Gentile; [...] to the righteous and to the wicked; to the elect and to the non-elect. (220.127.116.11)
Those who believe that only the elect are called to repent are actually called hyper-calvinists. For a comparison of their views on a somewhat similar passage, see my answer to: What is the Calvinist and Hyper-Calvinist understanding of the “whosoever will” from Rev. 22:17?
Returning to this passage, Calvinists see God here as commanding Cain to repent, to do what is right, and to resist sin, just as he commands all sinners to repent.
Indeed, in his commentary on this passage Calvin explicitly argues that God does not always give the ability to obey when he gives a commandment:
They, however, childishly trifle, who distort this passage to prove the freedom of the will; for if we grant that Cain was admonished of his duty in order that he might apply himself to the subjugation of sin, yet no inherent power of man is to be hence inferred; because it is certain that only by the grace of the Holy Spirit can the affections of the flesh be so mortified that they shall not prevail. Nor, truly, must we conclude, that as often as God commands anything we shall have strength to perform it, but rather we must hold fast the saying of Augustine, ‘Give what thou commandest, and command what thou wilt.’ (Commentary on Genesis)
That is: God commands all to repent and turn from sin, but he does not intervene to change the natures of all who hear that command. For some, the spiritual deadness of their nature remains, and thus they prefer to disobey the command and continue to live in sin.