We had a wonderful visit to the Adriatic coast by train a few years ago. This trip started Oct. 1 in Lake Como, so our train left from Milan. From Venice, it will be much shorter. We had visited Bologna before, so we didn't stop there. But frankly, there's so much to see along the Adriatic that I'd skip it on this trip.
Our first stop was Senigallia, a little south of Rimini. Because it was the end of season, we got a killer deal on a hotel, Hotel Palace, right on the sea. It was more of a business hotel, but we loved having an elevator after the 4-story trek to our room at Albergo Milano in Varenna. When we checked out, the front desk clerk presented us with a coffee-table book about Le Marche, in English, saying we were the first Americans to stay there. It was a lovely gift, which we enjoy having now, although not so much while we carried the 5 pound, 12" square book around for the next 3 weeks.
We haven't visited any of the other coastal towns you mentioned, but we loved Senigallia. It's a lively little town, with a wide, sandy beach that stretches for miles, a fort, daily markets and an archeological site. Wonderful restaurants. Two Michelin-starred places, a little pricey for us but people do travel here specifically to dine at them. Lots of small restaurants, although some were closed for the season. Our favorite was La Tartana, along the sea. Good seafood and pasta dishes. After a busy day of sightseeing, it was fun to sit there with our toes in the sand, watching the sea, with a glass of beer or wine and a great assortment of free snacks. A couple of times, we went back to our hotel, showered & changed & returned for dinner. From Senigallia we made day trips by train and bus. Once to Corinaldo, a beautiful little hill town. Another day to Grotte de Frasassi, a huge underground cavern. We did not visit Ascoli Piceno but wish we had -- it sounds lovely.
Our next stop was Trani, staying at Albergo Lucy. This is a lovely little Puglian fishing port, a good place to wander and eat. Another kind gesture -- our hotel owner drove us to Castel del Monte when he saw us looking at bus schedules. On the way back he took us to see a 12th century church and Dolmen La Chianca (a prehistoric burial chamber, with balanced stones like Stonehenge).
Then we took a bus to Bari, and immediately a train to Matera. This is a must-see place. Wanting a bit of pampering, we stayed at Locanda de San Martino, a lovely cave hotel with an underground thermal spa (pool, sauna, steam bath). We took a walking tour of Matera, which is helpful and interesting. Loved walking around the sassi after dark. If you can squeeze it in, a night in Matera would be a great idea.
When leaving, we rented a car at the outskirts of Matera and drove to a masseria (it's like an agriturismo in the rest of Italy). It was called Masseria Montenapoleone. Another great experience. While here we drove to the trulli villages (Alberobello and Locorotondo) and visited Torre Canne and other coastal towns. We spent one day lounging around the pool (it was an especially warm October) and wandering through the orchards.
We did not see Polignano a Mare, although it was nearby. If you want to see Matera and Alberobello from Polignano, consider renting a car for a few days (driving is easy in this part of Italy). Or visit Matera from Bari before going to Polignano.
Our final stop was Lecce. But you already have more than enough to fill your days. And lest you are tempted, this was our least favorite place. Tourist office was closed. NO eating facility opens til 8. About 100 churches ... we burned out. Visited Gallipoli -- gorgeous. Did not see Taranto.
Hope this is helpful!