Officials with the Riverside Police Department said the woman was trying to cross the tracks near the intersection of Mary Street and Indiana Avenue about 7 p.m. on foot. She managed to get the 2-year-old girl and stroller across in time, but was still on the tracks when the commuter train came.
"I was walking and all I saw was just the baby getting out of the railroad tracks," said witness Sandra Castillo. "What I did was get the baby because I didn't want her to get hit by other cars."
Police said the woman apparently ignored the warning signals and tried to beat the train.
"The arms were down, lights were going and she tried to cross anyway and the stroller got stuck and she didn't make it," Sgt. Kendall Banks said.
The girl was checked out at the hospital as a precaution. She was in the care of her grandmother.
None of the train's 50 passengers were injured.
The Burlington Northern Santa Fe Corp. - the freight company that owns the tracks - is investigating along with Riverside police and Metrolink officials.
The Associated Press contributed to this report.