Space permitting, the druid decides
It is essential to understand that just because an ancient brass dragon is Gargantuan, does not mean that it occupies the entirety of a 20' x 20' square. Rather, DMG Chapter 12 (Monsters) says:
Size. The Size Categories table shows how much space a creature of a particular size controls in combat...
and PHB Chapter 9 (Combat) says
Creature Size. Each creature takes up a different amount of space. The Size Categories table shows how much space a creature of a particular size controls in combat...
Space. A creature's space is the area in feet that it effectively controls in combat, not an expression of its physical dimensions. A typical Medium creature isn't 5 feet wide, for example, but it does control a space that wide...A creature's space also reflects the area it needs to fight effectively...
Squeezing into a smaller space. A creature can squeeze through a space that is large enough for a creature one size smaller than it...While squeezing through a space, a creature must spend 1 extra foot for every foot it moves there, and it has disadvantage on attack rolls and Dexterity saving throws. Attack rolls against the creature have advantage while it's in the smaller space.
Thus, one simple resolution is to reposition the body of the dragon such that the entirety of its physical form is outside of the antimagic field (without actually moving it - this is an absolute reduction in squares occupied, not a shift in squares). The druid would be permitted to retain the form of a dragon, but would not be permitted to control any space in which the field covered more than half the square. At the discretion of the DM, if this sufficiently restricted the area available to the dragon, it would also be subject to the squeezing condition.
The DM could rule that this simply happens per force to the positioning of the dragon, similar to other shape change effects that automatically take account of environmental circumstances. Or, the DM could allow the player of the druid to decide, and give them the choice: "In response to the antimagic field, you can adjust your positioning to retain your shape as a dragon. If you choose not to, you will resume your shape as a druid until such time as you can move further away from the field." I would suggest the latter, since as a DM I try to give players more choices and more autonomy.
Some might object that the druid could not adjust their position when it is not their turn. I consider this analogous to the standard condition of changes of facing being free even when it is not one's turn, being able to use a shield to defend against attacks from any direction, etc. (basically everything that is allowed when one is not using the optional facing rules from DMG 252)
To sum up, when the dragon is affected by the antimagic, we can assume that the dragon form is maintained, but in a smaller number of spaces. Only when the dragon itself no longer fits in the spaces available is it forced to revert to the druid.
The OP asks for the "best" way to resolve this paradox, but has neither put forth criteria for what the best resolution would be, nor had their question closed as opinion-based. I offer the following as recommendations for my answer:
(1) It is fun in that it allows both the shapechange and antimagic field spells to still be, at least partially, in effect. For both players it allows meaningful choices.
(2) It is fair in that it allows the antimagic field spell to impose limitations and disadvantageous conditions on the shapechange spell since it was chosen specifically to do that
(3) It is rules-based in that the restrictions imposed on the dragon shape are grounded in RAW for size, position, and squeezing
(4) It is quick in that the initial decision of what happens is based on a single assessment of the DM and then a possible decision by the player of the druid, rather than perpetuating a state of infinitely repeating transformations.
(5) It is tactical in that both players can use their positioning to further change the situation, but such changes are simple to resolve.