Laser-Driven Modulation of Electron Beams in a Dielectric Micro-Structure for X-Ray Free-Electron Lasers