Solution (source code)

= Solution

Here $a=p$ and $b=p^2$. For $E$, the four possible square classes are
$$
d\in\{1,-1,p,-p\},
$$
with coverings
$$
C_d:\qquad
w^2=du^4+pu^2v^2+\frac{p^2}{d}v^4.
$$
The classes $-1$ and $-p$ have no real points, because their right sides are respectively
$$
-u^4+pu^2v^2-p^2v^4<0,
\qquad
p(-u^4+u^2v^2-v^4)<0
$$
for every nonzero pair $(u,v)$. Hence
$$
|\operatorname{im}\alpha|\leq2.
$$

The two-isogenous curve is
$$
E':y^2=x(x^2-2px-3p^2).
$$
Its candidate classes and coverings are
$$
d\in\{1,-1,3,-3,p,-p,3p,-3p\},
\qquad
C'_d:\quad w^2=du^4-2pu^2v^2-\frac{3p^2}{d}v^4.
$$
The image of $\alpha'$ is a subgroup and contains $-3$, the image of the rational two-torsion point $(0,0)$.

Suppose now that $p\equiv7\pmod{12}$. Then both $-1$ and $3$ are quadratic nonresidues modulo $p$. The covering $C'_{-1}$ has no $\mathbb Q_p$-point. Indeed, after choosing primitive $p$-adic coordinates, if $p\nmid u$, reduction modulo $p$ would make $-1$ a square. If $p\mid u$, then $p\nmid v$; the right side has valuation two, and division by $p^2$ would make $3$ a square modulo $p$. Both alternatives are impossible.

Thus $-1\notin\operatorname{im}\alpha'$. A subgroup of the three-dimensional square-class group generated by $-1,3,p$ that contains $-3$ but not $-1$ has order at most four. Therefore
$$
2^{\operatorname{rank}E(\mathbb Q)}
=\frac{|\operatorname{im}\alpha|\,|\operatorname{im}\alpha'|}{4}
\leq\frac{2\cdot4}{4}=2.
$$
The rank is consequently $0$ or $1$.