Transport for Wales spends more than £8m a year paying dozens of “spare” train drivers and conductors, the Senedd has heard.