“If the righteous is scarcely saved, what will become of the ungodly and the sinner?”
What is your understanding of being "scarcely" saved? It certainly implies it is not easy or simple. The notes say the righteous are saved in the midst of suffering. This is in-line with Christ's statement in Matthew 24:13 "But the one who endures to the end will be saved."
The ones who persevere are the same ones who are saved—not the ones whose love grows cold (24:12). This does not suggest that our perseverance secures our salvation. Scripture everywhere teaches precisely the opposite: God, as part of his saving work, secures our perseverance. True believers “are being guarded through faith for a salvation” (1 Pet. 1:5). The guarantee of our perseverance is built into the New Covenant promise. God says: “I will put the fear of me in their hearts, that they may not turn from me” (Jer. 32:40). Those who do fall away from Christ give conclusive proof that they were never truly believers to begin with (1 John 2:19). To say that God secures our perseverance is not to say that we are passive in the process, however. He keeps us “through faith” (1 Pet. 1:5)—our faith. Scripture sometimes calls us to hold fast to our faith (Heb. 10:23; Rev. 3:11) or warns us against falling away (Heb. 10:26–29). Such admonitions do not negate the many promises that true believers will persevere (John 10:28–29; Rom. 8:38–39; 1 Cor. 1:8–9; Phil. 1:6). Rather, the warnings and pleas are among the means God uses to secure our perseverance in the faith. Notice that the warnings and the promises often appear side by side. For example, when Jude urges believers, “keep yourselves in the love of God” (Jude 21), he immediately points them to God, “who is able to keep you from stumbling” (Jude 24).