It happened late Wednesday night on Sharon Boulevard near Ellis Road in Madera.
The Highway Patrol said the man got his car stuck in the gravel near the train tracks. He was trying to scoop the rocks away from his tires when he was hit by the train.
The man was airlifted to Community Regional Medical Center. His condition has not been released.
A C.H.P. officer suspects the man had been drinking.