This research introduces an advanced Edge-AI and Internet of Things (IoT)-driven Digital Twin (DT) framework optimized for real-time process control and environmental monitoring within automated agricultural facilities. Traditional cloud-based agricultural monitoring systems suffer from high data latency, network dependency, and a lack of precise bidirectional control, which compromises the stability of delicate microclimates. To mitigate these limitations, this paper develops a localized, high-fidelity physical-digital synchronization framework utilizing a high-performance dual-core ESP32-S3 microcontroller running a FreeRTOS multitasking kernel. A lightweight, optimized Edge-AI neural network model (TinyML) was deployed directly on the edge node to handle real-time predictive analytics and anomaly detection for critical environmental parameters, including temperature, relative humidity, and soil moisture metrics. The continuous physical space is mathematically mapped using state-space formulations, enabling the Digital Twin to run parallel predictive simulations and dynamically adjust localized discrete proportional-integral-derivative (PID) loops. Experimental evaluations under real-world greenhouse conditions demonstrated that the localized Edge-AI model achieved a Mean Absolute Error (MAE) of just 0.12 for short-term microclimate forecasting. Furthermore, the edge computing architecture reduced data transmission latency by 87.5% (from 120 ms in cloud configurations to 15 ms at the edge) and decreased cloud bandwidth consumption by 92%. The synchronized DT control loop minimized process settling times to 0.45 s with a maximum overshoot of less than 5%. This framework successfully balances computational economy with precise, autonomous operational control, establishing a resilient blueprint for next-generation smart agriculture.