I'd put AOTC as the worst of the two for one simple reason: By the time it was made, Lucas should have known better.
With TPM, George Lucas had been out of the game for a while, so he can be (mostly) excused for giving us a movie starring a cartoon fish-rabbit with a head injury playing against a cardboard cutout of Liam Neeson with cotton balls taped to its face. He can even be forgiven for turning the Force into Space AIDS. Hell, I'd even go so far as to say he can be forgiven for giving us a Darth Vader portrayed as a clueless dipshit kid who shouts "Yippee!" and tries barrel rolls because that's a good trick.
With AOTC, Lucas knew better. He knew he was woefully under-equipped to write a serviceable script, and he knew his direction and use of CG had alienated a lot of Star Wars fans, but instead of handing duties over to someone else, he doubled down:
He (and his co-writer, to be fair) turned Darth Vader from a pants-wetting kid into a moody dipshit teen.
He replaced the cardboard cutout of Liam Neeson with the cardboard cutout of Ewan McGregor.
He decided to honor the fondness many fans had for the mysterious Boba Fett by removing all mystery about the character; instead turning him into a shitty clone of a shitty bounty hunter/assassin who lacks clear motivation and purpose.
He gave us "romantic" scenes with the same pacing, acting, dialog, and direction that one would expect from the pre-fuck part of a porno. If, during the infamous "coarse sand" scene between Darth Idiot and Queen Senator, a pizza delivery guy walked in and asked Padme if she's the one who ordered the large sausage, I don't think anyone would've batted an eye. We had all been brutalized into just accepting that the movie was terrible and that there was nothing we could do about it.
TLDR; Both movies are horrible, but AOTC had the benefit of seeing how poorly TPM was received and squandered its opportunity to course-correct. Which makes it the worst of the two, IMO.
And to quickly address the idea brought up by a couple people that TFA was worse than the prequels because it's a "retread," give me a break. It's better written, better acted, better directed, and better paced than the four Star Wars movies that came before it. That makes it a better movie.
Did it share some story beats with the first Star Wars? Sure, on a surface level. But it had to.
JJ Abrams and Co. weren't hired to reinvent the wheel. They were hired to undo the damage done by the prequels. They had to bring back the old Star Wars feeling while laying the groundwork for a whole new trilogy. Could certain factors have been more fleshed out? Sure. But that's why trilogies exist.
Disney bought the House of Star Wars with the plan to build it into a sprawling mansion. But they had to repair the damage done to the house by Hurricane George. The Abrams Repair Company was brought in to fix the place up. They were rebuilders, not remodelers. If Episode VIII doesn't deviate from the course, I'll understand the frustrations. But with Episode VII, the job was to rehang the drywall on a rickety frame.
All things considered, I'd say they did a pretty fucking impressive job.