Police say the man was waiting for an eastbound train to pass near Chicago Avenue when a westbound train hit him at about 4 p.m. Saturday.
The freight train was traveling from Barstow to Los Angeles.
The crash disrupted Metrolink service, but it has since returned to normal.
The man's identity was not immediately released by police, but authorities say he was 31 years old.