We present the use of interconnected optical mesh networks for early earthquake detection and localization, exploiting the existing terrestrial fiber infrastructure. Employing a waveplate model, we integrate real ground displacement data from seven earthquakes with magnitudes ranging from four to six to simulate the strains within fiber cables and collect a large set of light polarization evolution data. These simulations help to enhance a machine learning model that is trained and validated to detect primary wave arrivals that precede earthquakes' destructive surface waves. The validation results show that the model achieves over 95% accuracy. The machine learning model is then tested against an M4.3 earthquake, exploiting three interconnected mesh networks as a smart sensing grid. Each network is equipped with a sensing fiber placed to correspond with three distinct seismic stations. The objective is to confirm earthquake detection across the interconnected networks, localize the epicenter coordinates via a triangulation method and calculate the fiber-to-epicenter distance. This setup allows early warning generation for municipalities close to the epicenter location, progressing to those further away. The model testing shows a 98% accuracy in detecting primary waves and a one second detection time, affording nearby areas 21 s to take countermeasures, which extends to 57 s in more distant areas.