It's less about the brain size, I think, more about the metabolic cost of brains. Brains are among the most costly organs to keep what it comes to oxygen demand. Air-breathing increases available oxygen for the body, hence mammals have larger brains that for example fish.
In diving animals the metabolic cost of brains is connected to the diving time (can't find the reference at the moment). Sperm whales shut down parts of their brains on long dives and do not have particularly active brains in general. Dolphins are mostly shallow diving animals. Maybe the selection favors higher brain metabolism potentially increasing the ability to catch prey and avoid predators? Pure speculation, though.