I took the liberty of consulting with the Syzygy tablebases for a while, and came to the following conclusion: the endgame is drawn. This is far from obvious, but it has to do with the following fortress:
[fen "4Q3/5pk1/7r/6KP/8/8/8/8 w - - 0 1"]
Black draws this by shuffling the rook between e6 and h6. Bizarrely enough, as long as the h-pawn remains for white there is no way for white's queen and king to simultaneously attack the rook on h6, which is the key realization behind this fortress. The only thing black needs to watch out for is the fact that if white's queen is threatening to get to f8, then black needs to prevent this by making sure that their king is on g7 to cover the square. However, this is always possible for black to do, since with the black pawn on f7 there is no square on the board for white's queen where it would be covering g7 and at the same time would be threatening to go to f8. I chose to highlight the last part of the sentence, because it is critical. One final note before we move on: this fortress would hold no matter where white's queen and king is placed (as long as the white king stays on the 5th rank and below).
Let us now analyze a few key positions with the above fortress in mind, beginning with the tablebase win that OP found:
[fen "8/5p1k/6rp/8/3QK2P/8/8/8 w - - 0 1"]
This position is a win for white if white is to move, and the only winning move is Qc5. Don't ask me why this position is winning if white is to move, I actually don't fully understand it myself and can only say that it is indeed a tablebase win. I would actually recommend going over the winning lines with the tablebases online (https://syzygy-tables.info/?fen=8/5p1k/6rp/8/3QK2P/8/8/8_w_-_-_0_1), the way the queen manoeuvres to break black's fortress is quite astonishing.
In fact, place white's king wherever in the rectangle drawn up by a1 and f5, and you find that white is winning every time as long as they are to move in the above position. But things change if black is to move. It is immediately obvious that ...Rg4+ in the diagrammed position would be winning for black, but even if this move were not a possibility (as when white's king is anywhere except for e4), the position would still be a draw.
Question: what is the drawing idea?
The drawing idea is for black to play their pawn to h5. After this, there is no way for white to make any progress unless the white queen reaches f8. But this is easy to prevent, as black's king will always be able to reach g7 when this is threatened, as mentioned before. Even if white were to eliminate the h5 pawn this would still not be enough, since black would then achieve the fortress I discussed at the beginning of this answer.
Follow-up question (to test how well the previous information has been processed): If white is to move, why is Qc5 the only winning idea?
This is because Qc5 is the only move that sidesteps the skewer with ...Rg4+ while simultaneously preventing black from achieving the draw by means of ...h5, since white's queen threatens to infiltrate on f8 from c5.
We are now finally ready to deal with the initial position immediately:
[fen "3Q4/5pk1/6rp/6p1/4K3/6PP/8/8 w - - 0 1"]
We note three key points:
- The position is drawn if white were to play g4 here. Why?
This is because black would then shuffle their rook between e6 and g6 indefinitely, and the only way for white to make progress would be to push the h-pawn forward. But this would allow a trade of pawns, and the g-pawn cannot be used to stop the rook shuffle between e6 and g6. Again, all that black has to keep in mind is to avoid letting the queen into f8.
- If white were to push h4 in the above position, black has a concrete drawing line. What is it?
The drawing line is: 1.h4 gxh4 2. gxh4 (the only feasible winning attempt) h5! (and the drawing fortress is achieved for black).
- The only way for white to make any progress in the above position is to play either g4 or h4 at some point, since otherwise black will just shuffle the rook between e6 and g6, with no way in for the white king.
Using points 1, 2 and 3, we can say with confidence that the initial position must be a draw, as claimed in the first paragraph.