Too long for a comment, I just want to elaborate the last step of @user8675309's excellent answer (+1), namely how to argue $w = 0$ from the equation $(T + I_{(n)})w = A^{-1}wB + w = 0$, as this involves several interesting properties of the Kronecker product and the vectorization operator.
Applying the vectorization operator $\operatorname{vec}$ on both sides of $A^{-1}wB + w = 0$ yields (where we used the property $\operatorname{vec}(ABC) = (C^\top \otimes A)\operatorname{vec}(B)$):
\begin{align}
(B^\top \otimes A^{-1} + I_{(n^2)})\operatorname{vec}(w) = 0.
\end{align}
By condition, let $\lambda_1, \ldots, \lambda_n$ be all the positive eigenvalues of $A$ and $\mu_1, \ldots, \mu_n$ be all the positive eigenvalues of $B$, then $\{\lambda_i^{-1}\mu_j, 1 \leq i , j \leq n\}$ are eigenvalues of the order $n^2$ matrix $B^\top \otimes A^{-1}$, which are obviously all positive. Consequently, the eigenvalues of $B^\top \otimes A^{-1} + I_{(n^2)}$ are $1 + \lambda_i^{-1}\mu_j > 0$, $1 \leq i, j \leq n$, implying that the matrix $B^\top \otimes A^{-1} + I_{(n^2)}$ is invertible, whence $\operatorname{vec}(w) = 0$, i.e., $w = 0$.