At the end of the underwater ruins, you must battle a moai head named Broken Joe.
How to Defeat Broken Joe
Wait a moment for Broken Joe to come out of the wall. Broken Joe will move side to side as it slowly goes south. It will open its mouth and spit out snakes. Jump over the snakes and throw Baseballs into its open mouth if you have them. If not, hit it with the Shooting Star or the Star/Yo-yo.
Moving On
After you defeat Broken Joe, go north through the door, and go north again to exit the cave. Then you can proceed to part 2 of chapter 6.