Mission ends when all ghosts are stunned, so there has to be one hidden somewhere. I usually deal with this mission by bringing A LOT of agents with tazers and stunbattons, then transporting all the small ghosts into one place.
If you want, you can cheat in this mission, simply turn ON debug mode, look where the last ghost is, reload save and go there.
Other ways are to get everyone a motion detector.