No, you don't need 2.5 GHz bandwidth to transmit 2.5 Gbit/s. You can do it of course, but that would be very inefficient.
The data is encoded into symbols.
100Base-T Ethernet uses one pair in one direction and uses MLT-3 encoding to convert 4B5B encoded 125 Mbit/s bit stream into a signal that has 31.25 MHz bandwidth, so it uses 3.2 bits per hertz per channel.
2.5Base-T Ethernet uses all four pairs and complex encoding methods to achieve 6.25 bits per hertz per channel to end up being 100 MHz bandwidth for which the Cat 5e cable is rated for.
The encoding method includes the use of PAM-16 modulation, which means that each symbol on each wire pair is one of 16 voltage levels and thus carries four bits per symbol. It also uses Tomlinson-Harashima precoding (THP) precoding and DSQ128 encoding to achieve the goal of getting 2.5 Gbit/s sent over four pairs with 100 MHz bandwidth per pair, or 400 MHz total bandwidth for the whole link.