Why does the speed of the Electromagnetic wave in the material depend on the frequency of the wave where as they are constant in vacuum (freespace)?
I'm not going to go through this with equations, because that requires roughly a full chapter of a textbook. I'll just give a rough outline.

When electromagnetic waves travel through a material, they exert an oscillating force on the charged particles within that material. The charges move in response to this force, causing the material to be polarized. The polarization of each charge creates an electric field, which generates its own electromagnetic wave. The waves generated by the charges in the material are slightly out of phase with the original wave, and so the superposition of the original wave and the newly generates waves is a wave that travels slower than c. 

The change in propagation velocity depends on many factors, including the type of charge carriers present in the material and how they are bound to each other. For example, there will be electrons surrounding each atomic nucleus in the material, and also protons within the atomic nucleii. Since the nuclear charges are associated with particles with greater mass than electrons, they tend to interact differently. In particular they tend to polarize only for relatively low-frequency waves.

At some frequency, therefore, there must be a transition between a regime where a particular polarization mode interacts with the applied field, and where it doesn't. This happens at what we call a resonance frequency of the polarizability of the material. At resonance, we typically see a strong change in the velocity of the em wave through the material. Below resonance, the velocity begins to decrease (which we call anomolous dispersion, because at other frequencies the velocity tends to increase with increasing frequency), until just at resonance it increases dramatically, and then increases slowly until the next resonance.

So because of all this, the propagation velocity of an em wave depends on the material it is propagating through, and on it's frequency, since different polarization behaviors will be excited at different frequencies.

For the full version, refer to any first-year physics textbook intended for science and engineering students, or start with the Wikipedia article on permittivity.