Consistent Current Output From Batteries To DC Motors
You really need to provide a lot more information to be able to get any kind of a reasonable answer. From what little information that you did provide it is a pretty good bet that the batteries (8 x AA) are not up to the job of driving the motors. Eight batteries at ~1.5V in series produce about 12VDC. In all likelihood the voltage of the eight batteries is sagging down to the point that the motors run slower and slower. 

Your possible fixes for this could be one of:


Provide for a more capable battery back that will not sag in voltage during the duration of your test run.
Use a switching voltage regulator so that the voltage delivered to the LM298N stays constant instead of varying. You could use a step-up type to increase a battery pack voltage up to the 12V needed. If you created a higher voltage battery pack such as 18V or 24V then you could use a buck regulator to reduce the voltage to 12V needed.
You could install some type of sensor (rotary encoder) to the wheel shafts of the vehicle to detect how far each has turned. From this you could compute that you have traveled the required distance despite the speed that the motors are running. This would replace the open ended design you have now where the operating speed of the motors is critical.