I think the characters are more important.
I can't stand anime with trashy characters even when they have a good story but I can enjoy anime with a trashy story if it has great characters
depends. A comedy or slice of life anime for example doesn't really need a good plot if a plot at all, good characters will carry the show just fine.
In reverse if the plot & setting element are very important and well done, average characters won't be a problem for the show to be very good. Example would be Madoka. Madoka's characters are honnestly nothing to work home about. But the plot keeps us busy in a very nice way so it doesn't matter.
Other examples would include for example battle royal oriented shows. If lots of named characters keep dying, there's no way they'll have the time to be well developed, that's not the purpose of the show.
Definitely good characters for me. It's not like reading a book where you're focused more on the plot. In an anime, even though the story is basically non-existent good character dynamics and relationships can carry it a long way (then again, I guess you can call this good plot but whatever).
Good characters can salvage a lackadaisical plot, on the other hand a good plot can work with poor characters but without that attachment to the characters it falls short. Characters.