After some playing with this problem, I think I've found a solution.

Let $U$ be the orthonormal basis of the range of $I-\Pi$, that is, $[Q,U]$ is a square orthogonal matrix and $I-\Pi=UU^T$. Then
$$
\begin{split}
K&=\max_v\frac{v^T(I-\Pi)v}{v^T(I-\Pi)M(I-\Pi)v}=\max_v\frac{v^TUU^Tv}{v^TUU^TM^{-1}UU^Tv}
=\max_v\frac{v^T(U^TM^{-1}U)^{-1}v}{v^Tv}\\
&=\max_v\frac{v^T(U^TM^{-1}U)^{-1}U^TM^{-1}U(U^TM^{-1}U)^{-1}v}{v^Tv}\\
&=\max_v\frac{v^TU^TU(U^TM^{-1}U)^{-1}U^TM^{-1}MM^{-1}U(U^TM^{-1}U)^{-1}U^TUv}{v^TU^TUv}\\
&=\max_{v\in\mathcal{R}(I-\Pi)}\frac{v^T[U(U^TM^{-1}U)^{-1}U^TM^{-1}]M[M^{-1}U(U^TM^{-1}U)^{-1}U^T]v}{v^Tv}.
\end{split}
$$
What remains to show is that $$\tag{1}I-\tilde{\Pi}=I-Q(Q^TMQ)^{-1}Q^T\quad\text{and}\quad\Phi=M^{-1}U(U^TM^{-1}U)^{-1}U^T$$ are equal.
It is easy to show that the square matrix $[U,MQ]$ is nonsingular. So $I-\Pi=\Phi$ if and only if $[U,MQ]^T(I-\Pi-\Phi)=0$. But this is easy to verify using $U^TQ=0$ and the expressions in (1).