You should have taken the exchange on move 22. Your plan was working and then you gave up on it. What good would the pin of the pawn have done when there were only two rooks left in the game?
You would have been up three pawns and had a rook and pawn ending. It should be a very easy win, especially when your rook would already be centralized, and your king could easily cover the open file.
Here is a game I played with someone rated 200 points below me but lost, I think it is because of the danger of the passed pawn, but I will let you tell me just how bad It was and if you think my annotations are accurate. Any tips to help me prevent this from happening again are greatly appreciated.