Drones solve this issue. Really, whichever method removes the human delivery driver from the equation solves the issue, but drones make the most sense for several reasons.
One, drones enable a fundamental shift in the business model of food delivery. Instead of running a point-to-point logistics system relying on idle drivers, a restaurant could own its own logistics and operate as a hub-and-spoke system. What does this mean? The short answer is that this allows for sub-5-minute deliveries that cost less than $1. By placing the means of delivery in the hands of a restaurant, drones would fly back and forth from the restaurant as a hub, eliminating the bit of the journey not directly between the restaurant and the customer. Additionally, drones can travel as the crow flies, further increasing delivery speeds and taking advantage of underutilized airspace (where sidewalk robots falter). This means shorter wait times and preservation of food temperature and quality, which leads me to the second point.