This follows in a finite number of the division statements, if you use the prime factorization of both. If a prime divides one of them (the exponent of the prime is nonzero) then it divides the other, just from the first two statements
$$a\mid b^2 , b^2\mid a^3 .$$
Now let $m,n \geq 1$ be integers, the exponents in the prime factorizations,
$$ a = p^m \cdot \mbox{OTHER_A} $$
$$ b = p^n \cdot \mbox{OTHER_B} $$
Let $a,b$ be positive integers such that $a\mid b^2 , b^2\mid a^3 , a^3\mid b^4 \ldots$.....so on, then prove that $a=b$
For this prime $p$, the first few "divides" statements read
$$ m \leq 2n \; , \; $$
$$ 2n \leq 3m \; , \; $$
$$ 3m \leq 4n \; , \; $$
$$ 4n \leq 5m \; , \; $$
For any positive odd number $c$ we have the pair
$$ cm \leq (1+c) n \; , \; $$
Take $c > n$ so that $$ \frac{n}{c} < 1. $$
$$ m \leq \left(1 + \frac{1}{c} \right) n = n + \frac{n}{c} < n+1. $$
Put together, $m < n+1$ and
$$ m \leq n \; . $$
For even positive integer $d$
$$ d n \leq (1+d) m \; . \; $$
Take $d > m$ so that $$ \frac{m}{d} < 1. $$
$$ n \leq \left(1 + \frac{1}{d} \right) m = m + \frac{m}{d} < m+1. $$
Put together, $n < m+1$ and
$$ n \leq m \; . $$
As $n \leq m$ and $m \leq n,$ we have
$$ m=n $$
These were exponents of some prime $p$ that divides your two numbers. The argument applies to every prime that divides at least one of the numbers: the exponents are equal. Therefore $a=b.$