Around 10 p.m., the department's hazmat team responded to the area of Hesperian Boulevard and Springlake Drive, according to fire officials on the department's official Twitter feed.
The tracks are part of the Union Pacific Railroad.
At least two people were taken to hospitals with critical burns and another was also injured in the incident, which remains under investigation, according to fire officials.
California Highway Patrol Officer Peter Van Eckhardt said streets in the area were closed around 10 p.m. after police reported an explosion on the tracks.
As of 12:15 a.m., he said the streets were starting to reopen.
Around midnight, fire crews had left the scene, according to officials.