Rook and pawn can hold against a queen when the pawn shields the king, the rook stands protected beside the king, and no square around the king can be attacked without allowing a rook check or an exchange.
A queen is far stronger than a rook, but rook and pawn together can build fortresses the queen cannot break. Here Black's king on g7, rook on f6 and pawn on g6 form one of the standard constructions: the rook is protected by the king, the pawn is protected by the king and rook, and the squares around the king (f7, h7, h6, f8, g8, h8) can all be covered or re-covered by the rook along the sixth rank and the f-file.