A 5th level party? They will kill it in three rounds if it doesn’t kill them first.
Also, you talk about the ship “outrunning” the sea monster. A kraken (and most other sea monsters) will approach from underneath, so they won’t know it’s coming until it attacks. And any sort of controlled movement is going to be difficult for a ship in a storm in any case, and require skill checks.
There are rules for various types of storms in Ghosts of Saltmarsh.
Yep, I'll be using some of those rules. They'll be making the checks before they get to the kraken, as well as taking 1d6 lightning bolts that deal 2d10 damage. By the time the kraken appears they will be near the edge of the storm and done with those checks.
I tend to give objects damage resistance by default, and with the damage threshold, and the lack of siege monster on the juvenile, I won't be able to have it start the attack by reaching up a tentacle on each side and tearing off some of the railings--which would be cool. Its bite and lightning will bypass the damage resistance and should deal enough damage to hit the threshold, so I'll have it start the fight with one of those instead. Combined with the potential for some storm/lightning damage, that should encourage them to keep the ship moving, but not deal enough damage to knock its hull below half (which is when penalties would start in my revised/custom ship rules).
I'm thinking this kraken really likes to play with its food. First it will attack the ship from below to evoke some terror, then start picking off a few crew with tentacles, before finally really showing itself. It will continue to target whoever it thinks looks weakest, so the PCs will see the crew keep getting whittled away instead of them. It moves at the same speed as their ship, but it can Dash and they can't. This means it won't have any trouble keeping up, but as long as they keep moving (which will require the 2 PCs who are the temp captain and first mate to dedicate either their actions or bonus action each round to running the ship, while the other 3 PCs are free to act normally) they will get out of the storm within a few rounds, and it won't follow more than a round out of the storm. It shouldn't have any problem surviving with all the issues the PCs have to deal with, and it having 25% more hp, 2 legendary resistances (I think all legendary creatures should have some), and the weaker mythic style ability to recover half its HP, 1 leg res, and get a new legendary action if dropped to 0 (probably its clue to submerge and leave if it goes that far).
The fighter with the helm of underwater action might decide to dive in and fight it, but hopefully will realize that's a bad idea before getting eaten. Flying won't work in the hurricane force winds.
Even if they do defeat it, who's to say (from their perspective) that there aren't more similarly dangerous critters in that magical storm that is hanging around in about the same place for a week? In fact, there might be a sea serpent swimming around in there with an elevated chance of showing up as a random encounter if they head back that way. So it should accomplish its job either way.
Just hoping that fighter isn't feeling foolishly brave.
I also might run a test of the fight myself and see if there are factors I missed. (Pretty easy to do with Foundry, and I can just use a copy of the world so I don't have to clean up afterwards.)