The sets $A,B$ are closed and disjoint subsets of the compact set $X$, thus have a positive distance. Set $2\epsilon$ to this distance. Use uniform continuity of $f$ on the compact set $X$ to find the associated $\delta<ϵ$ so that
$$
d(x,y)<δ \implies d(f(x),f(y))<ϵ .
$$
Then there exists an $N$ so that, with $x_n=f^n(x)$,
$$
n>N\implies dist(A\cup B,x_n)<δ
$$
Now if $dist(A,x_n)<δ$ for some $n>N$, then using the invariance of $A$ one finds $dist(A,x_{n+1})<ϵ$ and as that implies that $dist(B,x_{n+1})>ϵ>δ$, one also concludes $dist(A,x_{n+1})<δ$. This means, continued via induction, that the forward orbit never comes close to $B$, so $B$ can not be a part of the forward limit set, in contradiction to the assumptions of the claim.