Fast answer
Choose Polignano when the cliff-town setting is the fixed reason for the stay and the trip can handle a more compressed base. Choose Monopoli when the base must carry several nights of beach choices, old-town dinners, rail movement, and onward planning. Polignano can still be the perfect focused visit from Monopoli, but it should not be asked to solve every coastal Puglia need if the trip really wants range.
If you only do one thing
Default to Monopoli for a first coastal base that needs flexibility. Default to Polignano for a short, deliberate cliff-town stay when the room approach, train plan, dinner timing, and sea conditions have been checked.