I purchased an e-bike which was advertised as just needing the batteries replaced. The li-ion batteries had been sitting dead for months. Once I got the battery removed it was clear that was not the case. You can see the hole where the plastic melted from this component overheating on the board. The burnt one is the same as those in the center of this photo.

What is it and how do I determine the correct replacement?