The righteous man in 1 Pet 4:18 is justified by faith, alone. Otherwise he wouldn't be righteous. It's not self-righteousness or righteousness by works (of law). "But to the one who does not work, but believes on Him who justifies the ungodly, his faith is accounted as righteousness." Rm 4:5.
"For by grace you have been saved through faith, and this not of yourselves; it is the gift of God." Eph 2:8. He's saved in the past tense. Saved from eternal damnation, by justification (and regeneration): it's a gift from God. Which contradicts the misinterpretation and semi-Pelagianism of Ellicott which suggests that he could've become unsaved or lost afterwards.
The salvation ("saved") in 1 Pet 4:18 doesn't refer to justification, but to glorification. "Inasmuch as you share in the sufferings of Christ, rejoice, so that also at the revelation of His glory you may rejoice exultingly." 4:13. "Therefore the elders among you I exhort, who am a fellow elder and witness of the sufferings of Christ, who am also a partaker of the glory to be revealed..." 5:1, 4. "But the God of all grace, He who has called you into His eternal glory in Christ Jesus, after you have suffered a little while, will Himself perfect, establish, strengthen, and ground you." 5:10.
Maybe it's beyond comprehension, but your question could someday be "What's the nature of salvation?" Salvation is personal and takes place in us and 'of' us. God saves believers from spirit to soul to body. It's a tripartite salvation, corresponding to our tripartite construction. "And the God of peace Himself sanctify you wholly, and may your spirit and soul and body be preserved complete, without blame, at the coming of our Lord Jesus Christ. Faithful is He who calls you, who also will do it." 1 Thes 5:23-24. (The "calling" there is the beginning salvation, the salvation of justification, the salvation of the spirit, of regeneration.) This ontological salvation--salvation of being--taught in Scripture also puts the lie to Ellicott's teaching and Barnes' as well--if by "often it seems to be wholly doubtful whether those who have been converted will be kept to eternal life" Barnes is referring to doubt by God. (Matthew Henry appears, hopefully, to have it right: "He will overrule all to the final advantage of the believer.")
Though works of believers do figure into salvation, it is not the salvation of justification. "They said to Him, What shall we do that we may work the works of God?
Jesus answered and said to them, This is the work of God, that you believe into Him whom He has sent." Jn 6:28-29.
Some examples: Based on 1 Cor 9, and 9:24-26 in their absolute immediacy, 9:27 refers to reward. Not to Paul being damned. Sadly, believers at times might be carried away, such as by Talmudic type Judaizing in Heb 13:9. This has nothing to do with eternal damnation and the penalty is not eternal damnation. 2 Pet 1 details the process of grace and organic salvation. 1:10 refers to the confirmation and affirmation of one's initial salvation. Absolutely not to the possibility of eternal damnation for a Christian. Such a demonic teaching is the height of what we/I call Pelagianism. Eg: you get up to godliness is 1:6, but come short of brotherly love and love in 1:8, so off to hell with you. Good try.
These examples are the salvation of the believer's soul. The 'hard part' of salvation. 2 Pet 2:20-22 refers to the earthly state and condition some believers can return to and sink to. It's no joke and not unconsequenceless. Though it neither mentions or refers to eternal damnation or going to hell, nor to the ontological impossibility of becoming unborn of God. "You therefore, beloved, since you know these things beforehand, be on your guard lest being carried away by the error of the lawless, you fall from your own steadfastness." 2 Pet 3:17. There's zero dispute that believers, children of God, may fall away. That's not in dispute. It's more than clear. Experientially as well as Scripturally. The question is of the consequences. And going to condemnation eternally isn't one of them. There are, of course, numerous verses alluding to reward and punishment, both in this age and the next, such as Gal 6:9 or 1 Cor 3. From some of them, Catholicism's derived it's peculiar notion of Purgatory. Heb 4:9 "So then there remains a Sabbath rest for the people of God," alludes to reward, on the positive side.