Fish migrating from lower salinities to higher salinities have to use more energy in order to address the osmotic problem. Hence this extra energy is to an extent, not available for reproduction. But the advantage is that, it gets higher Q & Q of feeds on which it can thrive upon. Second advantage is that the developing eggs get strewn over a wider area, ensuring the species getting more types of habitats. This ensures that at least some of the future developing stocks survive.
On the reverse side, it is the eggs that have to face the change in osmotic problem, when a fish migrates to areas of lower salinities. The advantage here is that, eggs do not have to face the harsh factors that the marine realm offers. Predators are comparatively less & the larvae has an option to cling to submerged materials to escape predation. Once developed, it overcomes osmotic problem to an extent, would then get the benefit of distribution in entering the marine realm.
Salinity is one of the important determinants of fish diversity, especially in migratory coastal and steno-haline fishes, which have narrow range of tolerance for salinity. Salinity fluctuations invariably affect fish distribution, diversity and reproduction in fishes owing to the osmo-regulatory requirements.
There's a great difference in reaction to salinity, whether static, specific to an area, or changing, as, e.g., due to seasonal floods or massive rains.
Examples: Euryhaline fishes like, e.g., threadfin seabream (Sparus aurata) and seabass bass Dicentrarchus labrax that spawn and grow at sea, but enter river mouths and inshore lagoons both, brakish and hypersaline for their own reasons, such as availability of food, absence of predators and competitors, etc. They're caught en mass, on their way out on their spawning migrations in channels, etc., connecting the lagoons with the sea. Also most grey mullets (Mugillidae) are euryhaline, which spawn at sea, but, similarly to the former, enter inland waters to feed and grow up.
On the other end are salmons (Salmonidae) that spawn up-rivers in truly fresh water and descend to feed and grow in the sea, usually far offshore. They are caught mainly on their spawning migrations. But most salmons are not truly euryhaline, for they won't spawn in seawater and won't stay in rivers. On the other hand, the a.m. bream, bass and mullets can spend all their life cycle in the sea.
I'm sure that there're plenty of other examples of species, each with its particular salinity preferences along its life span.