I know, in general, that it isn't true. ${\frac{2}{1}}^{1/2}$ is irrational. I'm only interested in this where $\frac{p}{q}$ and $\frac{a}{b}$ are positive, but to make this even simpler, lets just say that $a,b,p,q \in \mathbb{N}$.
I'm curious to know if there's an algorithm for figuring it out within the bounds I've mentioned, but I'm even more curious to know if it's true in general if you place additional constraints on the numbers.
Assume that $p$, $q$, $a$, and $b$ are positive integers. By dividing $a$ and $b$ by $\gcd(a,b)$ (found, say, by using the Euclidean Algorithm), we may further assume that $a$ and $b$ are relatively prime. Similarly, we may also assume that $p$ and $q$ are relatively prime. If they are not, first divide each by $\gcd(p,q)$.
So from now on assume that $\gcd(a,b)=\gcd(p,q)=1$.
Then $\left(\dfrac{p}{q}\right)^{a/b}$ is a rational number if and only if the exponent of each prime in the prime factorization of $p$ and of $q$ is divisible by $b$. Equivalently, $\left(\dfrac{p}{q}\right)^{a/b}$ is a rational number iff each of $p$ and $q$ is a perfect $b$-th power.
The Euclidean Algorithm is cheap and fast. That is not the case for factorization. However, by a suitable adaptation of Newton's Method, we can find out efficiently whether $p$ and $q$ are perfect $b$-th powers. We can also do it by adapting the old algorithm for square root that used to be taught in the schools. Detecting whether something is a $b$-th power can be done in not much more than linear time.