Steve C is right....those public transportation options make sense...
I would start first with ESTA to Lone Pine schedule...
Then work on the YARTS from Merced to Mammoth...
and then try to make it fit with an AMTRAK schedule from SF to Merced.
"Logisticalists" like me say "Move forward working backwards."