Battery?

my 2001 vw jetta tdi does start, but begins surging before it dies after driving for 20 minutes. the dealer says the battery is dead and my altenator is good. why would the car start, but not remain running if the battery was dead? the voltage with the vehicle off is 12.5, car running with no accessories is 13.8 and car running with all accessories on is between 12.3 and 13.8

Your problem has NOTHING to do with the battery. Sounds more like fuel starvation (that’s the only reason Diesels stop running). Check fuel filter(S) tank contamination, weak lift pump…

You may want to stop by TDICLUB.com They are all about diesel VW's.  

My guess is you got some bad fuel, likely a little water and there is alga growing in your tank and the fuel filter is clogging.  When was the last time the fuel filter was replaced? How along ago did this problem start?

You might want to get it fixed ELSEWHERE, then tell the dealer where to go!

Either the dealer is incompetent or dishonest.