Romans 1:18 mentions both ungodliness and unrighteousness in the same sentence. What is the difference between the two? Are they not the same?
Ungodliness means without piety (reverence, devotion) or to be impious. It is a dismissive attitude toward God. It is wickedness by implication.
Unrighteousness has to do with wrongfulness of character, injustice, and iniquity. It is more than an attitude, it is action. It is active wickedness.
The Hebrew word for wicked is rasa which means; ungodly or guilty. Rasa is a legal term meaning wrongdoing or being in the wrong. The person who has sinned against the law is guilty.
(For all have sinned and come short of the glory of God. Romans 3:23)
Rasa also denotes the category of people who have done wrong, who are still living in sin, and who are intent on continuing with wrongdoing.
The first Psalm exhorts the godly not to imitate the deeds and behavior of ungodly, wicked people. The wicked does not seek God. The wicked loves violence. The wicked oppress the righteous and the wicked does not pay his debts. The wicked lays a snare to trap the righteous.
For contrast between God’s dealings with the wicked and His dealings with the righteous*, see Psalm 37.
*the righteous – those to whom God has imputed the righteousness of His Son. Impute means to reckon, to put down to a person’s account.
For they being ignorant of God’s righteousness, and going about to establish their own righteousness, have not submitted themselves unto the righteousness of God. Romans10:3
And be found in him, not having mine own righteousness, which is of the law, but that which is through the faith of Christ, the righteousness which is of God by faith: Philippians 3:9
…let the word of Christ dwell (take up its life) in you richly…
 The Exhaustive Concordance of the Bible by James Strong, Hendrickson Publishers, Peabody, MA, p. 16, #763 asebeiav
 Ibid. , p. 8, #93 adikiav
[3,4,5,6&7] Vine’s Complete Expository Dictionary of Old & New Testament Words – copyright 1984,1996, Thomas Nelson, Inc., Nashville, TN, p. 287.