2. Given that $p$ and $q$ are both prime numbers, and satisfy $5 p^{2} + 3 q = 59$. Then the triangle with side lengths $p+3, 1-p+q, 2 p+q-4$ is ( ).
(A) acute triangle
(B) right triangle
(C) obtuse triangle
(D) isosceles triangle
2.B.

Since $5 p^{2}+3 q$ is odd, $p$ and $q$ must be one odd and one even. Since $p$ and $q$ are both prime numbers, one of $p$ and $q$ must be 2.
If $q=2$, then $p^{2}=\frac{53}{5}$, which does not satisfy the condition, so we discard it;
If $p=2$, then $q=13$. In this case,
$$
p+3=5,1-p+q=12,2 p+q-4=13 \text {. }
$$

Since $5^{2}+12^{2}=13^{2}$, the triangle with side lengths $5,12,13$ is a right triangle.