Perhaps the chip is over heating with to much current draw? Try connecting only two motors to see what happens.
For the l298n chip itself:
For the IO Peak Output Current (each Channel)
– Non Repetitive (t = 100ms) 3.0A
–Repetitive (80% on –20% off; ton = 10ms) 2.5A
–DC Operation 2.0A
TOTAL DC CURRENT UP TO 4 A