Depends what you need.
The macpro can be upgraded to a decent spec and would last you many years.
The imac is very old and not really upgradable so will not get much cash.
Monetary wise you would get more for the macpro, due to it’s expandability, but be stuck with an old iMac.