Early train detection is vital for ensuring the safety of railway personnel, particularly in remote locations where fixed signaling infrastructure is unavailable. Unlike many existing solutions that rely on high-power, high-cost sensors and compute platforms, this work presents a lightweight, low-cost, and portable framework designed to run entirely on resource-constrained microcontrollers with just kilobytes of Random Access Memory (RAM). The proposed system uses vibration data from low-cost accelerometers and employs a simple yet effective Linear Regression (LR) model for almost real-time prediction of train arrival times. To ensure feasibility on low-end hardware, a parallel-processing framework is introduced, enabling continuous data collection, Machine Learning (ML) inference, and wireless communication with strict timing and energy constraints. The decision-making process, including data preprocessing and ML prediction, completes in under 10 ms, and alerts are transmitted via LoRa, enabling kilometer-range communication. Field tests on active railway lines confirm that the system detects approaching trains 15 s in advance with no false negatives and a small number of explainable false positives. Power characterization demonstrates that the system can operate for more than 6 days on a 10 Ah battery, with potential for months of operation using wake-on-vibration modes.