The Lucena position is an intermediate endgame position involving a non-rook pawn on its 5th rank, with the defender's king cut off from the queening square, generally precluding a Philidor defense.
The first caveat is that just because your king is cut off doesn't mean that the Lucena is inexorable. If Black doesn't pay attention, White could try 1. Ke2 Rf7? 2. Rf1!. Exchanging rooks allows a drawn pawn ending. If the Black rook moves away from the f-file, the White King crosses to g1 and White can choose either the Philidor (camp the rook on a3 until the pawn reaches g3, then go to a8 and harass the Black King from behind) or even the First Rank defense against a rook pawn or a knight pawn (just shuffle the rook back and forth from a1 to f1).
Black to play wins starting with 1... Kh4 2. Rh1+ Kg3 3. Rg1+ Kh3 4. Rh1+ Kg2 driving the rook away. After Rh6
Now 5... g3 6. Rg6 Kh2 7. Rh6+ Kg1 8. Rg6 g2 9. Rg7 sets up Lucena
Standard Lucena continues with 9... Re8+ 10. Kd2 Re5 11. Rg8 Kf2 12. Rf8+ Kg3 13. Rg8+ Kf3 14. Rf8+ Kg4 15. Rg8+ Rg5
Whew! So that's the background. From the first diagram, what if we move Black's King and Pawn back one step?
1... Kh5 2. Rh1+ Kg4 3. Rg1+ Kh4 4. Rh1+ Kg3 5. Rg1+ Kh4. Black's attempt to land the Space Invader is repelled because he can't protect the pawn at g5 while driving the rook away as he did before. The crucial thing is that the White Rook maintains distance from the Black King and Pawn. If White plays Rg2 to stall at any point, then he may be lost again. e.g. 1... Rf7 2. Rg2? Kh5! 3 Rh2+ Kg4 4. Rg2+ Kh4 5. Rh2+ Kg3 and the rook has to run, giving Black time to get into the Lucena groove with g4. Even spotting Black another file won't always give him the win.
As long as White keeps his king in the red zone and his rook at g1, he should be able to draw using the Space Invaders defense. One subtlety is that with White to move or a Black finesse, 1...Re7 2. Kd2? is losing. 2... Re5! protects g5 and creates enough forward momentum to let the pawn squeak to g4. 3. Kd3 (second thoughts?) Kf5! 4. Kd4 (4. Rf1+ Kg4 5. Rg1+ (5. Kd4 Ra5) Kf3 6. Rf1+ Kg2) Re4+ 5. Kd3 and either 5... g4 or 5... Rf4 stay on track toward Lucena.
There is still some trickiness to deal with. After 5... g4 6. Rf1+ Rf4 7. Rg1 Kg5 8. Ke2 threatens the aforementioned drawing maneuver, but calmly advancing 8... Kh4 removes the danger of Rf1. e.g. 9. Rf1 Rxf1 10. Kxf1 Kh3. After the trickier 5... Rf4 6. Ke2 g4! is the lone winning move followed by 7. Rf1 g3! another lone winner. Game Over, Man!
A long time ago, I read Jeremy Silman's When a Philidor Position Goes Bad. But missing so many RPvR endgames at ChessTempo continues to reinforce that it's not all just Lucena and Philidor.