Quoted By:
Found a bug in latest patch. If you have a mon with speed boost in lead and encounter a ghost, you will be unable to flee, even if you switch pokemon. Using anything else as lead doesn't have any problem at all.
You either have to use a pokedoll or revert to a save before the battle since it will go on forever otherwise.