Spending on safety declined even as India poured money into its rail system.