At present, three contenders left (Kei, Milos and Ferrer) with two open slots.
Here is your complete guide to qualification scenario in a simple manner:
1. If Milos loses, the race is over; Kei and Ferrer take the train to London independent of who wins the match between them.
If Milos wins and then
2a. If Kei wins, Kei and Milos qualify.
2b. If Kei loses, Kei can still qualify with a high probability; the only way he cannot qualify is if Raonic and Ferrer both reach the finals and Raonic defeats Ferrer. In all other cases Kei qualifies and Milos qualifies if he goes one step further than Ferrer and Ferrer qualifies otherwise.