SAN FRANCISCO — A 21-year-old San Francisco man suffered a traumatic brain injury but is expected to survive after being hit by a San Francisco Municipal Railway light-rail vehicle Wednesday night in the city’s Dogpatch neighborhood.

The collision occurred at 8:19 p.m. at Third and Mariposa streets.

The victim got off one train and walked behind it to cross the street when an oncoming train hit him, Officer Albie Esparza said.

The man was taken to a hospital to be treated for his injuries, which are not considered life-threatening.