Running a Fischertechnik Encodermotor on Arduino

You should use a stronger power source, like the one of the Fischertechnik kits.

The L298 drops more than 2V, so that from 4 AA cells remain only 2,8V to 4V, what's not enough for the motor. Is your 9V supply strong enough for the motor?