A proper diesel-electric submarine like the one discovered at the weekend has the option of shutting down its engines and submerging fully to run on batteries. The sub is then completely invisible on radar and infrared: interdiction forces can then only locate it by using sonar, which is shorter-ranging, far less reliable, and very expensive to use on a large scale.Although some submarine hobbyists have long mocked the "drug subs" (see here) for being "crude" - an opinion that may require some re-thinking.
A modern military diesel-electric boat can travel some hundreds of miles on battery power, though with the disadvantage of moving at a crawl - it will travel less than a hundred miles in a day like this. Higher speeds are possible, but they slash range to a small fraction of the maximum.
The chances are that the Ecuadorian drug-sub had no such long-ranging fully submerged capabilities: it is probably only capable of shorter journeys entirely underwater, and intended to work in semi-submerged or surfaced mode much of the time, like a World War II German U-boat. In especially heavily watched waters, or if approached by law-enforcement units, the sub would dive and go slow on batteries, confident that it could no longer be followed.
Earlier posts (dating back to 2006) on drug subs here, here, here, here, here. And, a post from 2008 featuring an interview with Commander Cameron Naron, Deputy Chief, Coast Guard Office of Law Enforcement regarding these drug subs here. At the time of the interview, no such boats had been seen in the Gulf of Mexico or Caribbean. This seems to have changed and here.
A good post by Alex Pasternack here with some good video on the "older" models of drug semi-submersibles.