SHANGHAI — Hundreds of people were injured Tuesday when a subway train slammed into the rear of another train in a sprawling transit line that had opened just last year in Shanghai. The accident cast new scrutiny on the blighted safety record of China’s rapidly modernizing mass transit rail systems.