This is based on exercise 14.3 from Cassels, Lectures on Elliptic Curves. Let $$E:y^2=x(x^2+ax+b), E':y^2=x(x^2+a_1x+b_1)$$ be two elliptic curves over $\mathbb{Q}$, with $a_1=-2a$, $b_1=a^2-4b$. We know that this means there exists a 2-isogeny from $E$ to $E'$.
Part (a) of the exercise is proving that the groups $E(\mathbb{Q})$ and $E'(\mathbb{Q})$ have isomorphic odd-order torsion. I managed to do this, however the second part is: Assuming the Mordell-Weil theorem, show that $E(\mathbb{Q})$ and $E'(\mathbb{Q})$ have the same rank.
I know that $E(\mathbb{Q}) = E^{\text{tors}}(\mathbb{Q}) \oplus \mathbb{Z}^r$, where $r$ is the rank. How can I use this to prove that the curves have the same rank?
Consider the degree-$2$ isogeny $\phi:E\to E'$ and let $\widehat{\phi}:E'\to E$ be its dual isogeny. This just means that $\widehat{\phi}\circ\phi=[2]:E\to E$, where $[2]$ means is multiplication-by-$2$ map.
Now, since you assume the Mordell-Weil theorem, you know that $E(\mathbb{Q})\cong T_{1}\times\Bbb Z^{r_{1}}$ and $E'(\Bbb Q)\cong T_{2}\times\Bbb Z^{r_{2}}$, for some $r_{1},r_{2}\in\Bbb{Z}_{\geq 0}$, where $T_{1},T_{2}$ are the torsion subgroups of $E(\Bbb Q),E'(\Bbb Q)$, respectively. It is easy to see that the map $\phi:E\to E'$ restricts to a map
$$\phi:\Bbb Z^{r_{1}}\to\Bbb Z^{r_{2}}$$
since it sends torsion-free elements to torsion-free elements. This can be seen as follows: take a point $P\in E(\Bbb Q)$ and suppose that $\phi(P)$ it a torsion element in $E'(\Bbb Q)$ (i.e., not in $\Bbb Z^{r_{2}}$); then there exists $m\in\Bbb Z$ such that $\phi([m]P)=[m]\phi(P)=O_{E'}$ (here I denote by $O_{E'}$ the point at infinity of $E'$); hence, composing by $\widehat{\phi}$, we derive that $[2m]P=0$, which proves that $P$ is a torsion point of $E(\Bbb Q)$.
We can also observe that the restricted map $\Bbb Z^{r_{1}}\to\Bbb Z^{r_{2}}$ is also injective. This can be seen from the fact that isogenies have finite kernels, but in this case it follows also from the fact that $\phi$ is a degree-$2$ isogeny. Indeed, let $P\in E(\Bbb Q)$ be a torsion-free point and suppose that $\phi(P)=0$. Then, $[2]P=\widehat{\phi}(\phi(P))=0$, a contradiction to the choice of $P$.
We conclude (from the injectivity of $\phi$ restricted to the torsion-free part of $E(\Bbb Q)$) that $r_{1}\leq r_{2}$. Applying the same to $\widehat{\phi}$ we get the converse inequality and hence the equality $r_{1}=r_{2}$.