If you care about elite status definitely try to get on a UA codeshare because you'll get the relevant PQD and PQM to fulfill the yearly requirement.
If all you care about is award miles that you can redeem for free flights, flying on Austrian in J and then crediting the award miles to United will probably snag you a higher number of miles because it's distance based (with a multiplier for class you're flying)