When Adam falls, God curses the ground for his sake (Gen. 3:17). Nonetheless, Adam and his family are able to till the ground and get bread out of it (3:19, 4:2). After Cain murders Abel, however, he is cursed from the earth, so that it will no longer produce for him (4:11-12). He and his progeny turn out to be city dwellers or nomads (4:20), just as God said.
Note, however, the mercy and grace that Cain, a vile murderer, receives from God. As for mercy, he does not get his just deserts (death), which he knows, by conscience that he deserves (4:14--"everyone that findeth me shall slay me"). Cain receives grace in v. 15: (1) extra vengeance if anyone should slay him; and (2) a mark on him that will prevent men from slaying him. So he not only doesn't get what he deserves, but also gets some things he doesn't deserve. So it's true that grace runs all through the Bible (e.g. Gen. 6:8; Rev. 22:21), but God asks men to do different things in the dispensations to be saved. A few more examples of grace toward Cain: (1) he finds a wife; (2) God gives him a son; and (3) his progeny survive all the way up until the flood. True, all of his progeny perish in the flood, but the fact that Cain has any progeny is an example of God's grace.
Now a few thoughts on Lamech. These are from my study this morning, and not intended to be comprehensive.
Note how the word of God is passed down orally before Elihu (Job) and Moses (Gen.-Deut.) write the first scriptures. In Gen. 4:24, Lamech quotes what God said to Cain ("If Cain be avenged sevenfold..."). He perverts it, though--"If" casts doubt on what God said, and "truly" magnifies what he says (which is a lie). His name is the same as Noah's father (Gen. 5:28-31), and notice how some of Cain's progeny have the same names (including "-el" = "God") as Seth's (Enoch--4:17-18, 5:18; Methusael--4:18; 5:21; Lamech--4:18, 5:28). Maybe they were trying to appear religious by having the same names as the Sethites!
Devolution is shown in his bigamy (Cain was monogamous, as far as we know--4:17), and his boasting of his killing (4:23). Cain may have killed Abel, but he didn't boast about it. In fact, he probably tried to hide it from Adam and Eve, unless God approaches him immediately in Gen. 4:9 to enquire as to Abel's whereabouts. Cain may have said the same thing to his parents that he did to God, "I know not: Am I my brother's keeper?" (Gen. 4:10). Lamech's hideous pride shows up again in 4:24, where he boasts that retribution against him will be 11 times worse than that God promised to Cain, which is blasphemous nonsense. Man truly has "corruptible seed" (1 Peter 1:23).
A final thought from Gen. 4:26. Possible cross-references for "call upon the name of the LORD" are Ps. 50:15, Joel 2:32, and Rom. 10:13. The context every time is for deliverance, although men do call on him in prayer (1 Cor. 1:2, e.g.). Remember at this time, men apparently have weapons (Tubal-cain's output; cf. Goliath's brass and iron in 1 Sam. 17:5-7), and Cain's seed likely attacked Seth's, and prompted them to call upon the LORD for deliverance. Another possibility is the appearance of the angelic sons of God at this point (Gen. 6:2), and all the trouble that ensued (6:11). Thank God that he hearkens to those who call upon him with pure hearts (2 Tim. 2:22).
I love to study the first chapters of Genesis, which are so terse but so full of truth. The first 11 chapters of Genesis cover the first 2000 years of history! O LORD, how great are thy works! and thy thoughts are very deep (Ps. 92:5).