I suspect that some other game probably installed the DX9 files, many are still using DX9. Or perhaps Microsoft have woken up and updated DX to include them?
DX9 does get installed during Trainz install, but it's not normally the latest version. Are you sure you didn't update it previously from the Microsoft site?
I don't install anything from MS my automatic updates are turned off.
On both PCs I have DX9 from version 20 odd up so I don't think anything other than MS installation is responsible.