Let's write some equations.
Mingwei's distance from Town A after

hours from 8:00 is

.
Ali's distance from Town B after

hours is

, since he doesn't start walking for 40 minutes.
When Mingwei's distance is twice Ali's, they've met up (since their distance from Town A is twice their distance from Town B).
So, this gives

, so

, so

, so the time is 10:40.
After

hours, Mingwei has traveled

kilometers while Ali has traveled sixty, so the distance between the towns is

kilometers.