That would be most logical. If they were digging at the prison, someone would be bound to take notice. If the tunnel was built from the mosque to the prison, then no one could know until the tunnel was already created. Then they would just need to go to the mosque, and escape.
Exactly! I've never heard of prisoners digging a tunnel 140 yards long and escaping. It is just too hard to shore up and ventilate a tunnel of that length. Even the "Great Escape" tunnel in WWII was only 300 feet, and they had engineers on hand. Obviously, either the "escape" was an inside job, or the tunnel was mostly dug from the outside.
IMO it's very likely (as in "I can't really see how it WOULDN'T happen this way") that there was also an "inside job" component, so that the from-the-mosque tunnel-rats knew exactly where to have the tunnel terminate underneath the prison.