The answer is that if the axioms of set theory are consistent, then you cannot prove that conclusion. Although it seems very reasonable to expect that a smaller set must have strictly fewer subsets, which is another way of stating your property, in fact this property is independent of ZFC.
(The fact that many people find this surprising is the reason I posted this answer to the MO question requesting examples of reasonable-sounding statements that are independent of ZFC.)
You are asking whether the continuum function $\kappa\mapsto 2^\kappa$ is injective, and it turns out that if ZFC is consistent, then this assertion is neither provable nor refutable in ZFC.
On the one hand, the property is relatively consistent with ZFC, as you observe, since it follows easily from the GCH.
On the other hand, it is known by the method of forcingforcing to be relatively consistent that the property fails. Specifically, in Cohen's original model of $\text{ZFC}+\neg\text{CH}$, he forced over a model of GCH to add $\omega_2$ many Cohen reals, and the result is $2^\omega=2^{\omega_1}=\omega_2$ in his model, which violates your property. Cohen's model has an uncountable set $B\subset\mathbb{R}$ that has the same number of subsets as the countable set $A=\mathbb{N}$. This is usually one of the first nontrivial forcing arguments that set-theorists learn, when first exposed to the technique, and when teaching this, I invariably find the situation somewhat magical.
It is also a consequence of Martin's AxiomMartin's Axiom that $2^\kappa=2^\omega$ for all $\kappa\lt\frak{c}$, and if one has MA plus $\neg\text{CH}$, which is known to be relatively consistent by the forcing method, then there are again counterexamples to the requested property.
Meanwhile, one can show by forcing that the injectivity of the continuum function is not equivalent to GCH, since by Easton's theoremEaston's theorem, one can find a forcing extension (of any model of GCH) in which $2^{\aleph_n}=\aleph_{n+2}$ for every natural number $n$, and otherwise the GCH holds. Such a model exhibits the desired injectivity property, but does not satisfy GCH. One can use Easton's theorem more generally to make even more extravagant violations of GCH, while still ensuring an injective continuum function.