Fast answer
Bari Airport to Monopoli or Polignano by train takes two trains. Ferrotramviaria's airport stop is inside the airport, through a 300-metre tunnel from arrivals, and the operator puts the airport 17 minutes from Bari; at Bari Centrale a pedestrian tunnel leads to the RFI station for a Trenitalia regional train south on the Bari to Lecce line, which stops at Polignano a Mare and Monopoli. Monopoli is the steadier arrival base for luggage, dinner, and next-day flexibility; Polignano is the sharper choice only when the cliff-town stay is already the point of the trip.
If you only do one thing
Default to Monopoli for a first no-car arrival unless Polignano is already booked or central to the trip. The safer plan is to keep the airport transfer, onward train, check-in, and first dinner as simple as possible, then use Polignano as a focused rail day after the arrival friction is behind you.
Car hire fallback only if the rail connection does not fit