You can't. I once almost bought an e-bike that had dead batteries.
-I asked the same question on this forum and on endless-sphere.com, but nobody knew of a way
to test an ebike with dead batteries.
-If the ebike looks good, without much corrosion and visibly damaged wiring and connectors, it will probably run with little or no tinkering.
-if the wiring insulation is melted in places, it will likely need repairs possibly parts before it will run.
3 SLA bricks can cost as little as $120 or so if ordered from a vendor on the web.
-Sorry to sound like Capt Obvious, but you may just need to use your intuition to decide.