Experiments by Dickey et al. [Langmuir22, 4315 (2006)] and Leach et al. [Chaos15, 047506 (2005)] show that novel pillar shapes can be generated from electrohydrodynamic instabilities at the interfaces of thin polymer/polymer/air trilayer films. In this paper, we use linear stability analysis to investigate the effect of free charge and ac electric fields on the stability of trilayer systems. Our work is also motivated by our recent theoretical study [S. A. Roberts and S. Kumar, J. Fluid Mech.631, 255 (2009)] which demonstrates how ac electric fields can be used to increase control over the pillar formation process in thin liquid bilayer films. For perfect dielectric films, the effect of an ac electric field can be understood by considering an equivalent dc field. Leaky dielectric films yield pillar configurations that are drastically different from perfect dielectric films, and ac fields can be used to control the location of free charge within the trilayer system. This can alter the pillar instability modes and generate smaller diameter pillars when conductivities are mismatched. The results presented here may be of interest for the creation of complex topographical patterns on polymer coatings and in microelectronics.