You can try cutting the cable back and putting a new lug on it. To do this right, you really need to take the cable out of the boat and be able to work on it. Or, you can measure the cable and make up a new one. If you reuse the old cable, replace both ends. And cut it back until you are sure you are looking at uncorroded strands.
I use Ancor 4-0 cable; it is the largest battery cable I could find and their quality seems the best. It is expensive. However, this is one of these instances where I just buy the best I can and defend that on the grounds that anything cheaper will be less satisfactory and less safe. The amount of amps that flows through these wires while cranking is formidable.
I do not use big cable like this for charging conductors. I use it from the battery to the switch, from the switch to the starter, to the inverter (if applicable) and FOR ALL RETURNS AND GROUNDS. Both sides of the current path have to be the same size. There is no universal ground in a boat like there is in a car. You are wiring BOTH legs of the circuit- out to the load and back- and they have to be equal size for this application.
For charging wires- the ones that run from the charger itself to the batteries-I use AWG 6, I think it is. It is the largest size that, once stripped, would fit into the lugs on the StatPower charger unit.
Welding cable or automotive battery cables are not good enough for this application, I think. The Ancor lugs are the best, and most WM outlets will let you use the tools (the huge crimper and etc, also the little sledgehammer) that you use to make the connections. And then you need a heat gun or butane torch to do the shrink wrapping.
The amps required to crank a diesel will melt a high-resistance connection fairly quickly. There are some instances in marine products where one company's products really do lead the field, and Ancor stuff is one of those instances. Given that battery cables do their job in an environment where it is hard to monitor their condition, and that it is not the easiest service in the world, it pays here to get the best.