Yes, this is called the Rubber Band Effect
Generally, what is happening is the A.I is trying to present a challenge to you without seeming completely impossible to beat. When you are driving worse (or if you are a newer player not used to the ins and outs of the game) the A.I. players drive slower.
When you pick up your game and start racing faster, the A.I compensates by making the enemies faster as well.
The reason this is called 'Rubber Band' is because it is like having an invisible rubber band between you and the other racers. When you are slow, you drag on them, when you are fast, you drag them along.
You can also see this effect in the weapon pickups available to you - when you are winning, you'll mostly get banana skins and fake pickup boxes. when you are losing, you'll get homing shells etc.