Battery becoming very hot

If the blue wire in both photos is the same, then the wire 'swap' is on the inside. Please confirm.
Most likely one of those two black wires on the ammeter's 'red' stud goes to the main junction. If so, that's why the ammeter reads wrong.

Check the engine side wires. Those could have been altered as well.
The red one should connect to a fusible link and attach at position J.
The heavy black from the alternator should go into position P.

Then we can discuss fixes.