Final answer:
The most cost-optimal solution is to set up a CloudWatch alarm to monitor the instance, and on failure, automatically reboot the instance using EC2 Reboot CloudWatch Alarm Action.
Step-by-step explanation:
The most cost-optimal and resource-efficient automated solution to address a taxi dispatch application that regularly freezes on an Amazon EC2 instance would be Option A: setting up a CloudWatch alarm to monitor the health status of the instance. Upon detection of an Instance Health Check failure, a predefined EC2 Reboot CloudWatch Alarm Action can be configured to automatically reboot the instance. This method leverages AWS's native tools to respond to issues without incurring additional costs or resource uses associated with continuously running a Lambda function or initiating unnecessary reboots.