Synchronous communication between two Arduino boards using two ESP8266 modules
The esp8266 WiFiMulti system allows to configure more access points and with the rigth code in loop it always searches the best AP.

Configure one of the esp8266 as AP and setup the other with WiFi Multi only for this one  access point.

You can then use events like onStationModeConnected to handle data exchange if the connection is established.