As you progress on the tracks and get up to S rank (the highest) the AI gets harder. Depending on the car you choose and the tires you use the AI's cars change. If you are having problems beating the AI, just keep practicing. If you want specific tips for cars or tracks you can ask here.
If you are pulling away from the AI after the first corner on S rank, try the TAC for more of a challenge.