First road bike, decade old quality or lower end and new?
For context, my current road bike is a 2010 Cannondale Six Carbon, which would be a comparable model to the Madone you're looking at.

I would say you will still get much more bike from the used Madone than from any new bike in a similar price range.  But to help you out, let's go over what has changed in the last 10ish years in the road biking world at the mid-high end, and how much of that has trickled down to more entry level models.


Groupsets: Drivetrains have moved from 10 speed to 11 and now even 12 speed.  On the high end, electronic shifting has gone from rumored, experimental tech to near ubiquity, but this has not yet trickled down to entry level models, so it's not especially relevant to this discussion.  As for the addition of the additional sprocket or two, it does generally give you a slight bit more range if you live in a very hilly area, but otherwise I expect you won't notice much of a difference.  Note that some tech has trickled down in terms of design and machining, so the entry level components on a new bike are actually very similar in build quality to the midrange components the 2009 Trek would have.
Brakes: The last few years, the bike industry has made a significant push to introduce disk brakes into the road cycling world, and a new bike will probably come with disks rather than rim brakes.  This change has actually been somewhat controversial, with many cyclists unhappy that they are being "forced" to move to disks and questioning whether there is actually enough benefit from disk brakes to justify the additional costs and difficulty in maintaining them.  But that is a whole discussion on its own...
Frames: In general, carbon fiber frames have gotten lighter and more aerodynamic, although surprisingly not that much stiffer.  The biggest difference is the introduction of vibration damping elements, such as Trek's IsoSpeed decoupler, which have increased the comfort of newer bikes without sacrificing other performance characteristics.  Having said that, a high quality carbon frame from 2009 will still be lighter and better performing than an entry level aluminum bike from today.
Wheels: Fairly minor changes all in all, but most people have moved from 23mm wide tires to 25mm or even 28mm; as a result, rims have gotten slightly wider.  On the high end, deep section carbon rims have also become much more popular, but any bike spec'd with carbon wheels is going to be several thousand dollars.  Going along with the groupset point above, wheels from 10 years ago will probably not be able to hold an 11 or 12 speed cassette, which is often the limiting factor when upgrading an existing bike to a new drivetrain.  Similarly, old wheels will not have mounts for disk brake rotors, for whatever that's worth.
Saddles: No groundbreaking changes to saddles, just minor refinements, but newer saddles are probably a bit more comfortable.  This is a highly personal thing that's easy to swap out, though.
Cockpits: In the name of aerodynamics, integrated cockpits have become increasingly common on high end bikes.  These certainly make the bike faster in the wind tunnel, but are proprietary and importantly may restrict the amount of adjustments you can make to find your optimal fit.  Regardless, they have not (yet) found their way onto entry level bikes.  Basic aluminum handlebars and stem are mostly unchanged in the last 10 years.


As you can see, while there have definitely been many improvements and technological shifts in the bike industry in the last decade, most of those improvements have not trickled down to the entry level, are comparatively minor, or may even come with their own drawbacks.  On balance, I'd lean towards the old, high end bike, but with the awareness that standards have changed and it may be more difficult to get parts for it over time.  If there's any reason to avoid the old bike, that'd be why.