Edit: The quoted question addresses only numbers of the form $p^a q^b$, I asked a general question for arbitrary $n$.
If $n$ is a prime or a product of 2 primes then knowing its totient $\varphi(n)$ allows us immediately to find the prime factorization of $n$.
How about a general case? Does knowing $\varphi(n)$
- give us a way how to find the prime factorization of $n$,
- help as find a prime factor of $n$, or at least
- help at in finding any factor of $n$? (This turns out to be obvious.)
In the case of a prime, you can just observe that $\phi(n)=n-1$ to know it is prime. If $n=pq$ is a product to two primes, $\phi(n)=(p-1)(q-1)$, which you still need to factor. If you already know it is the product of two primes, you can use $\phi(n)=n-p-q+1$ to get $p+q$ as a second equation. As $\phi(n)$ has at least a couple factors of $2$ and may have other small factors, it will be somewhat smaller and can be easy to factor. Hagen von Eitzen makes a good point in the comment. If $n=pqr$, all prime, $\phi(n)=(p-1)(q-1)(r-1)$ and I don't see a good way to make headway except looking for small factors.