user15405: This is my initial position:

I exchanged my pawn to get queen at this position:

Now to complete the tactics, the engine is accepting only this move which results in a stalemate

I would have dominated black with my queen and bishop but the tactics did not allow to do so which implies losing queen is better. But I don't understand why.
I am trying to understand why is Q5f the best move for white.

user16758: At this position you pretty much lost already - except if you can save yourself into a stalemate. That is exactly what is happening in your example. Qf5 forces black to make a decision between one of the following choices: He can either move his king or his pawn, or he can take your queen.
If he chooses to move the king out of check or block the check with his pawn, white is free to take the black queen. While it is not an easy victory, playing with a queen against two bishops and a pawn can still be won.
If however black chooses to take white's queen, then white will be trapped in a stalemate, resulting in a draw. Getting half a point is better for white than losing (and getting no points). Given the imbalance of the material, there is also no way that white can win this endgame (against a reasonable well playing black player).
Explanation for the stalemate: After the white queen is taken, white only has his king left. But the king can't move anymore. The square d4 and d2 are controlled by black's (black) bishop. d3 and e2 are controlled by the black bishop on b5 and e4, d3 (again), f4, f3, f2 are all under the control of black's queen.

15405: <p>This is my initial position:</p>

<p><a href="https://i.stack.imgur.com/UqYuZ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UqYuZ.jpg" alt="enter image description here"></a></p>

<p>I exchanged my pawn to get queen at this position:</p>

<p><a href="https://i.stack.imgur.com/84WTt.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/84WTt.jpg" alt="enter image description here"></a></p>

<p>Now to complete the tactics, the engine is accepting only this move which results in a stalemate</p>

<p><a href="https://i.stack.imgur.com/pHZfK.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pHZfK.jpg" alt="enter image description here"></a></p>

<p>I would have dominated black with my queen and bishop but the tactics did not allow to do so which implies losing queen is better. But I don't understand why.</p>

<p>I am trying to understand why is Q5f the best move for white.</p>
 16758: <p>At this position you pretty much lost already - except if you can save yourself into a stalemate. That is exactly what is happening in your example. Qf5 forces black to make a decision between one of the following choices: He can either move his king or his pawn, or he can take your queen.</p>

<p>If he chooses to move the king out of check or block the check with his pawn, white is free to take the black queen. While it is not an easy victory, playing with a queen against two bishops and a pawn can still be won.</p>

<p>If however black chooses to take white's queen, then white will be trapped in a stalemate, resulting in a draw. Getting half a point is better for white than losing (and getting no points). Given the imbalance of the material, there is also no way that white can win this endgame (against a reasonable well playing black player).</p>

<p><em>Explanation for the stalemate:</em> After the white queen is taken, white only has his king left. But the king can't move anymore. The square d4 and d2 are controlled by black's (black) bishop. d3 and e2 are controlled by the black bishop on b5 and e4, d3 (again), f4, f3, f2 are all under the control of black's queen.</p>
