Assuming that this is a competition of some sort, and everyone has the same set of powertrain components (motor, batteries), then the best way to maximize the output of that powertrain is to characterize them and find the peak output in terms of torque at a given speed. It would be valuable to find this at a range of speeds starting from 0 so you can understand the acceleration curve building up to the optimal speed and torque. This will require some experimentation on your part, but once found you should be able to build a gear train that best utilizes the maximum possible output from this powertrain. Note that electric motors aren't entirely linear, so there will be a peak, but the batteries will be more responsible for the peak than the motor.
If you can insert additional components, such as a DC/DC converter and push a higher voltage into the motor (at the cost of more current from the batteries) then you can enhance the maximum output of the motor, though you will likely wear out the motor faster. For short distance/time events, though, this isn't a big concern. Chances are you won't be allowed to do this, though.
If you can choose the AA batteries you use, test out many types, and always use new batteries for every single run.
Also, if the weight of the vehicle isn't counted as part of the load, minimize the weight of the vehicle. Lower mass will result in faster times, and if the vehicle mass isn't counted then that's the best way to optimize the final score.