There are 2 questions here.
- Will changing my bike make me faster?
- Will a more expensive bike be faster than a less expensive bike?
The Defy is a good bike, but it’s an endurance bike aimed at long distance comfort over speed. If speed, especially over shorter distances is important to you, then there are many bikes that are more suited to that. they will put you in a more aggressive position, they may be more aero and/or lighter, and they may be more nimble. It’s not all good - they might also be less forgiving, and the aggressive position might actually be difficult for you to sustain without pain.
If you stay within the same category of bike, then once you are above a certain point, spending more gets only marginal improvements. A Dura Ace version of a bike is only going to be marginally faster than a 105 version (and probably from the wheels and other components rather than the groupset). It will be lighter though.
To conclude - if you spend 2.5k on the best Defy you can get, you won’t go much faster. If you buy a TCR (or equivalent), then no matter what you spend, you are likely to go a bit faster because of the position.
However, as everyone else has said, the most important thing that determines whether you go fast is the rider. Alaphilippe would still fly on my bike (assuming it would fit him!), I still be quite slow on his.