let $A,B$ be two positive semi-definite $n\times n$-matrices such that
$$\mathrm{Range}(B^{1/2}AB^{1/2})=\mathrm{Range}(B)$$
and
$$\mathrm{Rank}(A)=\mathrm{Rank}(B)=n-1$$
so is there a real symmetric matrix $X$ such that :
$$A=XBX$$
let $A,B$ be two positive semi-definite $n\times n$-matrices such that
$$\mathrm{Range}(B^{1/2}AB^{1/2})=\mathrm{Range}(B)$$
and
$$\mathrm{Rank}(A)=\mathrm{Rank}(B)=n-1$$
so is there a real symmetric matrix $X$ such that :
$$A=XBX$$
Presumably the matrices are real. The answer is then yes.
Without loss of generality we may assume that $B=D\oplus0$ for some positive diagonal matrix $D\in M_{n-1}(\mathbb R)$. The range condition thus implies that the leading principal $(n-1)\times(n-1)$ submatrix $P$ of $A$ is non-singular (and hence positive definite). But then the rank condition implies that $$ A=\pmatrix{P&Pu\\ u^TP&u^TPu} $$ for some vector $u\in\mathbb R^{n-1}$. Now let $$ X=\pmatrix{Y&v\\ v^T&z}, $$ where $Y\in M_{n-1}(\mathbb R)$ is symmetric. The equation $A=XBX$ can then be rewritten as $$ \pmatrix{YDY&YDv\\ v^TDY&v^TDv}=XBX=A=\pmatrix{P&Pu\\ u^TP&u^TPu}.\tag{1} $$ To solve $YDY=P$, we rewrite it as $(D^{1/2}YD^{1/2})^2=D^{1/2}YDYD^{1/2}=D^{1/2}PD^{1/2}$, which is solvable by $D^{1/2}YD^{1/2}=(D^{1/2}PD^{1/2})^{1/2}$ or $$ Y=D^{-1/2}(D^{1/2}PD^{1/2})^{1/2}D^{-1/2}.\tag{2} $$ The equation $YDv=Pu$ in $(1)$ is then solved by $v=D^{-1}Y^{-1}Pu$, and \begin{aligned} v^TDv &=(u^TPY^{-1}D^{-1})D(D^{-1}Y^{-1}Pu)\\ &=u^TPY^{-1}D^{-1}Y^{-1}Pu\\ &=u^TP(YDY)^{-1}Pu\\ &=u^TPP^{-1}Pu\\ &=u^TPu. \end{aligned} Hence $XBX$ is indeed equal to $A$.