Railways have emissions standards different from road vehicles. And VW cheated because they couldn't pass European regulations, the thing is that the big lawsuit took place in the US because US courts allow far bigger monetary amounts.