An old question, but with a distinguished pedigree. Fermat and Mersenne also considered this back in 1643 but in the context of positive Pythagorean triples $(a,b,c)$ and made things harder by requiring fourth powers,
$$a+b = n^2\\a^2+b^2 = m^4$$
I. Second powers
For the OP's question,
$$a+b = t^2\\a^2+b^2 = c^2$$
The second equation is routine and we use $(a,b)=(p^2-q^2,\,2pq)$. Substitute into the first,
$$p^2+2pq-q^2=t^2$$
Do the substitution $(p,q) = (r-s,\,s)$ to get the conditional equation,
$$r^2-2s^2=t^2$$
$$r^2+ns^2=t^2$$
For general $n$ and primitive $(r,s)$, this has the complete solution,
$$(x^2-ny^2)^2+n(2xy)^2 = (x^2+ny^2)^2$$
with Pythagorean triples just the case $n=1$. Undoing all the transformations, then the general solution to your question is,
\begin{align}
a &= (x^2 + 2 y^2) (x^2 - 4 x y + 2 y^2)\quad\\[4pt]
b &=\, 4 x y (x^2 - 2 x y + 2 y^2)
\end{align}
For example, let,
\begin{align}
(x,y) &= (1,1),\quad\text{yields}\; (a,b)= (\color{blue}{-3,\,4})\\
(x,y) &= (1,2),\quad\text{yields}\; (a,b)=\, (\color{blue}{\,9,\,40})
\end{align}
which are the two values you found.
II. Fourth Powers
For the special case when the Pythagorean triple has a square hypotenuse $(a,b,c^2)$, understandably this would need larger numbers. The smallest Fermat found was,
$$4565486027761+ 1061652293520 = \color{blue}{2372159}^2\\
\;\;4565486027761^2+ 1061652293520^2 = \color{blue}{2165017}^4$$
To find infinitely many, let $(a,b)=\left(\dfrac{p^2+r}2,\;\dfrac{p^2-r}2\right)$, then,
$$a+b = p^2\\
a^2+b^2 = q^4$$
where $(p,q,r)$ must satisfy,
$$p^4-2q^4=-r^2$$
Compare the similarity to the conditional equation for second powers. There are also infinitely many solutions,
$p = 1, 1343, \color{blue}{2372159}, 9788425919, 5705771236038721, \dots$ (A167437)
$q = 13, 1525, \color{blue}{2165017}, 42422452969, 7658246457672229, \dots$ (A166929)
though if we require positive $(a,b)$, then a subsequence of $q$ is (A166930) and the blue numbers are the smallest.
P.S. The equation $p^4-2q^4=\pm r^2$ appears in a special case of $a^4+b^4+c^4=2d^2$ in this MSE post and which led me to this topic.