I want to check if for matrices
$$ A = \begin{bmatrix} 1 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 1 & 0 & 1 & 0 \\ 0 & 0 & 0 & 2 \\ \end{bmatrix}, B = \begin{bmatrix} 4 & -2 & 0 & 0 \\ 3 & -1 & 0 & 0 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 1 & 1 \\ \end{bmatrix} $$ there exists an orthogonal matrix $P$ such that $B=P^{-1}AP$.
Since $P^{-1}=P^T$, this is equivalent to checking that $B=P^TAP$ (which is the definition of congruence). My first idea was to cast this as a bilinear form:
$$A=G(h;st)=\left(M(id)_{st}^{\mathcal{A}}\right)^TG(h;\mathcal{A})M(id)_{st}^{\mathcal{A}}$$ where $B=G(h;\mathcal{A})$, $h$ is a bilinear form and $st$ is the standard basis. If we knew $\mathcal{A}$, we would be done. However, I don't see a straightforward way to find this basis. I would appreciate any hints.
Since $A$ is symmetric and $P$ is orthogonal, $P^{-1}AP$ must be symmetric, but $B$ is not symmetric, hence we can't get such a $P$.