They don’t routinely go after animals for food (which is what I would consider “prey”) unless they have a pretty big advantage, although an occasional hunter may be hurt or killed. In some cultures, such as the Masai, young warriors may have to kill a dangerous predator like a lion as a test of courage, but that’s not the same as going after prey.
With respect to the OP, I am not aware of any evidence that a giant squid has any ability to keep a sperm whale from surfacing. As has been said, the whale far outweighs it and is much more powerful.