Fact: Two matrices are unitarily equivalent, then they have the same characteristic polynomials.
I find both of the matrices $\begin{pmatrix} 1 & 1 & 0 \\ 0 & 2 & 2 \\ 0 & 0 & 3 \end{pmatrix}$ and $\begin{pmatrix} 1 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 3 \end{pmatrix}$ to have the same characteristic polynomials. But they are still not unitarily equivalent. I am not sure why.
For each square matrix $A$ by $A’$ we denote its transpose and by $A^*$ the complex conjugate of its transpose. The second matrix $B$ in your question is real-valued diagonal, so $B=B’=B*$. Then for each unitary matrix $U$ we have $(U^*BU)^*=U^*BU$, so the matrix $U^*B^*U$ is Hermitian and so it cannot be equal to the first matrix $A$ from your question.