Ye olde commuter is ~ 300 wh/mi. 31 mi (50k) means you need 9300 wh + efficiency loss. Increase by 20% for DoD and Peukert, you get 13.4kwh. Divide by 144v = 93 Ah. Lithium batteries, new, are about $1.20 /Ah or so, so you're looking at 45 x 120 = $5,400 for a new pack. If you can find some used at less than half that price, that's great, but you'll want to test the voltage on those batteries carefully. Why would someone be getting rid of them if they were still good? Sometimes you can find batteries like that (I did) but lithium batteries are pretty new and unlikely to be cycled out for no-reason.
Your range is pretty in keeping with PbA, which would cut your initial investment. Some argue that lithium is cheaper over time, but if you can get running now and let your budget grow for a new pack later, that might be an option you want to consider.
A good DC motor will be at least $1-1.5k new. That's 6.9k USD before a controller and the other electric bits. You can save some money there by getting used, but it's hard to predict pricing because it will depend on what's available near you. If you can get a good forklift motor and controller that can save you big bucks; some people have gotten working parts for as little as $250.