Look up "Tehachapi Loop Overlook" on Google maps satellite view. Basically a wide spot in the road. That's where you would have to turn around...which you may or may not be able to. I wouldn't take the chance.
We went there in our car. We also had it on our bucket list. Had driven by Tehachapi many many times. One time during an RV trip, we finally stopped for an overnight. We looked at the railroad loop, and also did a neat self-driving tour of the wind farm. You can find the tour online if you Google it. Gets you up close to the wind mills. Also, we ate at Keene Cafe, which I think might be the diner that DennisVR is referring to.
Keep in mind that if you are just stopping for a quick look see, you may not get to see a train coming through...unless, of course, you know the train schedule.
On another note...along 58...we had another bucket list item that we finally visited. That was the Borax Mine. There is a friendly little RV park in Boron. You can't tour the mine, but there is a great visitors center atop a hill with a good view of the mine. Also a fun little museum in town to visit. (Though maybe all closed now with the current situation.)