$
\def\bra#1{\langle#1|}
\def\ket#1{|#1\rangle}
$You need to use linearity. Apply the assumption $\bra{\psi}A\ket{\psi} = \bra{\psi}B\ket{\psi}$ to the case $\psi=\phi_1+\phi_2$ and expand using the linearity of the inner product in the first term and the conjugate symmetry. Then cancel terms you know to be equal from the assumption.
You'll should then arrive at the expression (I'm writing the inner products out in full rather than bras and kets):
$$\langle\phi_1,\,\Delta^\dagger\,\phi_2\rangle +\left(\langle\phi_1,\,\Delta\,\phi_2\rangle\right)^\ast = 0\tag{1}$$
where $\Delta = A-B$ and with $\dagger$ standing for the adjoint operator and $\ast$ standing for the complex conjugate (one can use the same symbol for both, because their domains differentiate them, but I've used the two symbols for easier reading). Now apply first-argument-linearity to the above expression to the case where we use $i\,\phi_1$ instead of $\phi_1$. You should get
$$\langle\phi_1,\,\Delta^\dagger\,\phi_2\rangle -\left(\langle\phi_1,\,\Delta\,\phi_2\rangle\right)^\ast = 0\tag{2}$$
and (1) and (2) will get you what you need.