Well the red wire is part of a fuse holder, the P.O. probably had an accessory wired to the battery, maybe a bilge pump, the third black wire with the yellow terminal is most likely the ground for the added accessory. You might want to trace those two wires and see where they go, if the accessory has been removed, the remove the wiring.
Lou