Calculation of overdamped c-axis charge dynamics and the coupling to polar phonons in cuprate superconductors