Wiring of Robot car going to damage Arduino? And powering the project

Did you measure the output of the batteries? 12vdc AA batteries should work longer than 15 seconds, unless the L298N is "that" power hungry (sorry). Maybe read about the TB6612FNG (dual motor driver). I use an 8.4vdc battery pack to tinker with a two-wheel motor "robot" car turning methods for many minutes during the day, and recharge them at night. I will need to do a "drive till it dies" test one day.

thanks for the advice but unfortunetly, the competition only allows for a maximum of 6 1.5V batteries. But after it's done I will try and see.

You should be getting much more than seconds of driving if you are connecting the full 6xAA * 1.5v = 9v battery pack directly to the Arduino VIN and L298N +12. Have you seen other competition entries?

It was working fine after I ran 9V to the Arduino and L298N in parallel. Before, I ran 6V to the L298N and 9V through the Arduino, and that was when the motors would sometimes stop moving.
No I have not seen the other competition entries, I have it this Saturday, wish me luck!

Very good. Good luck.