Our Puglia Train Travel Times Map shows times for some typical rail journeys around Puglia. The lines in red represent the faster and more expensive Eurostar Italia trains.
For comparison with driving times, the distance between Foggia and Bari is about 120 kilometers. The Autostrada (Italy's fast toll roads) route between these two cities could be managed at a top speed of 130 km/hour. Allowing for stopping to pay tolls, this journey should take around an hour in a car, as it does on the Eurostar. The regular train takes 40 minutes longer because it stops at many smaller stations. The cost of the rail journey at time of writing is 7.44 Euros.
You can use the form on Trenitalia to check the schedules and times to cities in Puglia. A network of rail and bus transportation to towns within Puglia is quite extensive, and is run by a company called Ferrovie Sud Est, which offers maps of their bus and train routes (click on "territorio" to see the train line map, then click "cartina autobus" to see the bus map).
Should you drive or take a train in Puglia? Well, personal preference plays a part, but there is a lot to see in Puglia's countryside that might only be accessible by car. That said, rail travel in Italy is fairly inexpensive, and if you're doing a solo trip you'll save money on the travel and you'll not have to deal with navigating. Your choice.
The distance between Naples and Bari, taking the A16 to A14 Autostradas, is 261 km, a two hour drive if all goes perfectly, at the speed limit of 130km/hr.