If you have the trolley to go from Oceanside to downtown, you’d also greatly reduce the traffic on the I-5.
Oceanside to Union Station, SD is almost 40 miles — more of a suburban train line. Far too long to be sitting on a trolley that does at most 50 mph, probably 35-40 mph with stops. Better to dual track the existing coast line from O’side, electrify it at 25kV, and run regular electric multiple-unit railcars.
Something like a Silverliner V would work and is already approved for US rail lines…