Let us imagine a heterojunction with one side called A and the other side called B. Both A and B are n type materials with different doping levels. A has a higher conduction band energy than B, but B has a higher Fermi level. Can electrons diffuse from B to A even though A has a much higher conduction band energy and B has a higher Fermi level? Will thermal equilibrium be achieved in this case?