Earthquakes are known to sometimes be preceded by unexplained balls of light much further in advance. If this phenomenon is related, the warning period likely exceeds just a few seconds.
Japan's high-speed rail lines are already programmed to shut down when a significant earthquake is (automatically) detected from body-wave arrivals.
Of course, this only helps if you're not very close to the epicenter of the earthquake.
Also, not to be too pedantic, but "earthquake lightning" has only been reliably documented after or during earthquake rupture. It is a weird and apparently real phenomenon, though.
E.g. http://www.ep.sci.hokudai.ac.jp/~heki/pdf/2011GL047908.pdf
I haven't heard of an infra-red-visible precursor of any sort, at any rate, though I could be very wrong there.
http://www.technologyreview.com/view/424033/atmosphere-above...
HAARP
</tinfoil>