The sets $S_1$ and $S_2$ are defined as $S_1 = \left\{(x,y,z) \in \mathbb{R}^3_{+} : z = \frac{1}{xy}\right\}$ and $S_2 = \left\{(x,y,z) \in \mathbb{R}^3 : (x-4)^2+(y-4)^2 + z^2 = 5 \right\}$.
Consider the function $f$ that is given by the points of $\max(z(S_1), z(S_2))$. (Given $x,y$, if $z$ exists twice, then we choose the larger $z$ and its corresponding $x,y$.) Find $\max(f)$ subject to $3x+4y \geq 5$.

Here is a picture I plotted using Geogebra. For the function $f$, we choose the positive values of the sphere (red) in the region where it exists, and everywhere else, it is $\frac{1}{xy}$ (purple/violet). The blue plane denotes the equation $3x+4y=5$.
Can we solve this using the Lagrange multiplier?
I am essentially trying to understand when we can and when we can not use LM. The idea behind this is to draw a function that is not monotone throughout, so I added the sphere. The goal is to check whether the LM method gives $(x,y) = (\frac{3}{5},\frac{4}{5})$ as the optimal value or the point on the sphere $(x,y) = (4,4)$ to maximize $f$. Ideally, it should be the latter. But I couldn't calculate this. I would like to know if the monotone nature of $f$ is really needed in general or not. (Do consider the possibility of non-linear constraints.)
By monotonicity of $f$, it is referred to the partial derivatives wrt $x$ and $y$ being $> 0$.
It is not possible to use the Lagrange multiplier theory for two reasons:
Monotonicity of $f$ is not needed (anyway, there is no reasonable notion of monotonicity for functions from $\mathbb R^2$ to $\mathbb R$).