Assuming that $A \in \mathbf{R}^{n \times n}$ is symmetric and $B$ positive definite, we know that there are $n$ real eigenvalues for the generalized problem $Au=\lambda B u$, with B-orthogonal eigenvectors. If these eigenvalues are labeled decreasingly, then we have
$$ \max _{V^TBV=I} \mbox{Tr} \left( V^T A V \right) = \lambda_1 + \cdots + \lambda_d $$
for any orthogonal $V \in \mathbf{R}^{n \times d}$. Why is $B$ supposed to be positive definite? Why not just symmetric or positive semidefinite?
If $B$ is not invertible, the polynomial $\det(A - \lambda B)$ has degree less than $n$. If the degree is $m$ with $0 < m < n$, there are only $m$ generalized eigenvalues (counted by multiplicity). Or it could be that the polynomial is identically $0$, e.g. if there is some nonzero $u$ with $Au = Bu = 0$, and then $u$ is a generalized eigenvector for every $\lambda$ (real or complex).