Three ways for a gate to sag:
(1) The posts to which the gate is hung are insufficient for carrying the weight of the gate or aren't anchored in the ground properly to prevent them from tilting over time. A 12' long gate is going to exert some serious downward force at the unsupported end of the gate, and the longer the lever, the less force is required to move whatever is at the opposite end of the lever -- in this instance the post.
Your post needs to get exponentially stronger as the gate gets longer.
For a 12' gate that stands 4' high, I would use 10" x 10" x 10' posts, anchored in post holes six feet deep and at least 3' in diameter, then filled with the most durable concrete I could find, including a polymer product of your choice to prevent cracking.
If I was making a ridiculously heavy gate, I would probably double up the posts on the side holding up the gate, putting two posts on the hinge side, about a foot apart so they could hold up the gate together.
(2) The horizontal supports are not adequately attached to the posts. Hardware is the most common point of gate breakdown, either the screws/bolts attaching the gate to the post come out, loosen, etc.
Or, the hinges bend or break.
There are gate hinges rated to 1,000 per pair. They'll cost you around $75 per pair. But you need to anchor them in the posts so that they won't loosen or come out, or dig into the wood due to the force being exerted on them.
You could mount a steel plate to the post, sort of like a big washer to distribute the force across the post, then lag screw the hinge into the post through the plate. But you'll need to pre-drill your holes in the plate on your drill press first.
(3) The gate itself is not structurally sound.
Either the horizontal members warp or aren't strong enough to carry the load, or the weight of the gate eventually pulls the top horizontal member away from the hinge, turning the whole thing into a big parrallelogram.
Diagonal bracing is good, just make sure it runs from the unsupported top corner (furthest from the hinge side) down to the bottom hinge.
The closer that diagonal terminates to the bottom hinge, the better.