Back of the napkin here:
California consumes 9.54 * 10^17 Joules of electricity / year, or 1.09 * 10^14 Joules / hour.
Suppose we wish to hold in storage enough energy to supply to grid for twelve hours, since the sun does not shine at night. Assume we have a 100% efficient method of recovering potential energy stored on a train. Suppose we find a suitable mountain with a 1000 meter height differential. Then according to e = mgh, we would need to shift a load of 1.33*10^11 kilograms to supply twelve hours of electrical demand.
Let's assume we use the cheapest rock we can to fill this mass. I assume you can get wholesale pea gravel for $8 a metric ton.
Then the cost of gravel alone is $1.07 billion.
That doesn't sound so bad, but remember, this project will need ~1333500 100-metric-ton freight cars. Suppose they cost $120,000 / ea. Then suddenly, the cost of the train cars is 160 billion.
This is on the order of magnitude of the entire California yearly state budget. And also ignoring a bunch of other cost factors that will increase the total price by another 1-2 orders of magnitude.
Pumped storage hydroelectric is viable precisely because the reservoir holds your water for essentially free. Train cars are far, far more expensive.