The future is not necessarily set in stone in the way it is sometimes conceived to be. I don't know if people have watched the series "Heroes" here, but let me give an analogy from that. When in the series, they see a vision that new york city was going to be destroyed, they come back and warn people about it. It would have been destroyed if nothing had changed. But things were changed, and so consequently it wasn't destroyed. That's an example of how the future changes when the present changes. For someone who wants a Biblical example, I will give the example of the Prophet Jonah. Notice that at first, he announced to the city that it was going to be destroyed i.e. that it was on the path of destruction. But the people repented and did fasting and penance for their sins. And so they were saved, and the future changed, and they were not destroyed then. How did the future change? They changed it by changing the present.
So for e.g. to come back to our sermon, the Saint could very well have had a supernatural intuition, say, that 90% of those in that audience present there - IF THEY REMAINED AS THEY WERE - would be lost. That is, they were in mortal sin and on the path to hell. Thus his prophetic warnings were just and necessary. And yet it doesn't follow from that that necessarily 90% of those were finally lost. Why? Say 80% of them heeded his warnings and changed their lives. Then the hypothetical future would have changed, and a different future would have been realized. In that actual future, because of repentance and change of life, the 80% who changed+the 10% who were already on the path of salvation=90% in all would have been saved. We always have the power, with the aid of God's Grace, to change the future from what it otherwise would have been. We are not puppets on a string in a Calvinist puppet-show.
This would explain the Saint's ending well. And it also fits with that example of that Saint he gave, who himself feared being lost, and then did great penance for 40 years, and ended up being saved and a Saint. In one place, St. Alphonsus mentions St. Theresa - a Great Saint who never committed a single mortal sin in her whole life - see in a vision the hypothetical place prepared in hell for her, i.e. the place where she would have gone if, despising the Lord and refusing her vocation, she fell into that grave sin and remained obstinate in final impenitence until the end. But of course we know it didn't turn out that way. She completely corresponded to the Lord's Graces, and remained faithful to Him all her life, never committing a single mortal sin, and becoming one of the Great Saints of the Church.
So one should (edit:) NOT despair or worry too much. One should have a salutary fear of God, a hatred of sin, a desire to be holy, a love for righteousness, great trust in God, abiding faith and a deep hope in Him. Faith in God, hope in God and love of God are great virtues we should seek to grow in every day of our lives. We exercise our hope by firmly hoping, from God's Goodness, to receive Final Perseverance in His Grace.
God Bless.