usually if the connectors between the truck and battery melting tells me it is either just bad connections due to loose spring tabs in the connectors, not holding the contacts in the connector together tight enough. Or the terminals are not crimped correctly.
the part about the cables on the battery tho makes me suspicious, 4/0 cables are a bit small
what voltage is the truck? i'll assume 36/48?
it could be the batteries were mis-spec'd and have the wrong size cable.
Also could be the truck is not setup correctly, high amp draw from incorrect motor settings maybe?
one thing is you can get a clamp on amp meter and monitor the trucks amp draw while operating it and see if it is running high. There is also another device you can use called a 'power prover' that hooks up between the battery and truck and monitors the power usage, most reputable dealers have one or your local battery service company should.
This is ONLY to be used to report flooding, spam, advertising and problematic (harassing, abusive or crude) posts.