Electrostatically driven apparatus for measuring work function differences