Define
$$
f(x,t):=\mathbb E[e^{-r(T-t)}X_T^{\frac{2r}{\sigma^2}} \vert X_t=x]\,,
$$
where the Ito-process, $\text dX_u = rX_u\text du + \sigma X_u\text dW_u\ $ (with $X_t=x$), and the Weiner process, $W_u$, have been defined with respect to some suitable underlying filtered probability space (with filtration $\{\mathcal F_t\}_{t\geqslant 0}$). Now, by solving the SDE defining the process $X_u$, we obtain
$$
X_u=xe^{(r-\frac{1}{2}\sigma^2)(u-t)+\sigma (W_{u}-W_{t})}\ \ (\text{for }u\geqslant t).
$$
Thus, by considering conditional expectations with respect to the sigma-algebra $\mathcal F_t$,
$$
\mathbb E[e^{-r(T-t)}X_T^{\frac{2r}{\sigma^2}} \vert \mathcal F_t] = e^{-r(T-t)}\mathbb E[X_T^{\frac{2r}{\sigma^2}} \vert \mathcal F_t] = e^{-r(T-t)}\mathbb E[(xe^{(r-\frac{1}{2}\sigma^2)(T-t)+\sigma (W_{T}-W_{t})})^{\frac{2r}{\sigma^2}} \vert \mathcal F_t] = e^{-r(T-t)}x^{\frac{2r}{\sigma^2}}e^{\frac{2r}{\sigma^2}(r-\frac{1}{2}\sigma^2)(T-t)}\mathbb E[(e^{\sigma (W_{T}-W_{t})})^{\frac{2r}{\sigma^2}} \vert \mathcal F_t] = e^{-r(T-t)}x^{\frac{2r}{\sigma^2}}e^{\frac{2r}{\sigma^2}(r-\frac{1}{2}\sigma^2)(T-t)}\mathbb E[e^{\frac{2r}{\sigma} (W_{T}-W_{t})}]\,,
$$
where $\mathbb E[e^{\frac{2r}{\sigma} (W_{T}-W_{t})}\vert \mathcal F_t] = \mathbb E[e^{\frac{2r}{\sigma} (W_{T}-W_{t})}]$ since $(W_{T}-W_{t})$ is independent of $\mathcal F_t$.
So,
$$
f(x,t) = x^{\frac{2r}{\sigma^2}}e^{-2r(T-t)}e^{2\frac{r^2}{\sigma^2}(T-t)}\mathbb E[e^{\frac{2r}{\sigma} (W_{T}-W_{t})}]\,.
$$
We are almost done; we simply need to evaluate $\mathbb E[e^{\frac{2r}{\sigma} (W_{T}-W_{t})}]$ using the fact that $W_{T}-W_{t}\sim\mathcal N(0,T-t)$. Note that,
$$
\begin{eqnarray*}
\mathbb E[e^{\frac{2r}{\sigma} (W_{T}-W_{t})}] &=& \frac{1}{\sqrt{2\pi(T-t)}}\int_{-\infty}^{\infty}e^{\frac{2r}{\sigma} w-\frac{1}{2}w^2/(T-t)}\text dw \\ && \\& = &\ldots \\ && \\
& = & e^{2\frac{r^2}{\sigma^2}(T-t)}\,.
\end{eqnarray*}
$$
Therefore,
$$
f(x,t) = x^{\frac{2r}{\sigma^2}}e^{-2r(T-t)}e^{4\frac{r^2}{\sigma^2}(T-t)}\,.
$$
If you are curious, you can convince yourself that the solution above is correct by showing that it satisfies the given PDE: simply compute each of the partial derivatives and plug them in the PDE.