I haven't tried this but...
I used to use Bondo Liquid Fiberglass Resin to make a few things when I was into 1/6 military figures and tanks. Most of the time I made molds using Smooth-On rubber then poured the Bondo into the mold, but once in a while I simply mixed/poured the Bondo directly into a cavity to fill it up.
Maybe this resin could be poured into the bottom of the car without it draining out. Once hardened the resin is fairly strong and it can be drilled/tapped. I've used duct tape to form retaining walls so the resin stays where I want it and so it won't get on any surfaces and cause damage to the paint.
You could even make a form/mold so you could make multiples.
The resin does get warm while curing, the thicker it is the warmer it gets. In O scale it shouldn't be a problem.
The kit comes with the liquid resin and a tube of hardener, last kit I bought was either at Walmart or one of the auto places like Advanced Auto or Pep Boys.
Smooth-On also makes some great for pouring parts, there may be a place near you that is a distributor, but check the expiration date before you buy. The last I bought local had an expired date on it and I didn't realize it until later, could only use about 1/2 the kit.
Here's 2 photos of a WWII Russian Aero Sled I built a few years ago. The 3 attachments that go from the skis to the main "fuselage" were cast using Bondo: