It seems from this Medrash that the
fish were all destined to go into the mouth of the leviathan and not live forever from the time of the 6 days of creation, even before Adam sinned by eating the fruit. In turn the Leviathan would be slaughtered and eaten at the great feast of the Tzadikim in the in the final redemption.
Pirkei deRabbi Eliezer chapter 10:
רבי טרפון אומר: ממונה היה אותו הדג לבלוע את יונה מששת ימי בראשית, שנאמר (יונה ב, א): "וַיְמַן ה' דָּג גָּדוֹל לִבְלֹעַ אֶת יוֹנָה "אמר לו הדג ליונה: אין אתה יודע שבא יומי להאכל בפיו של לויתן? אמר לו יונה: הוליכני אצלו, אמר יונה ללויתן: בשבילך ירדתי לראות מקום מדורך שאני עתיד ליתן חבל בלשונך ולהעלותך ולזבוח אותך לסעודה הגדולה של צדיקים
That fish's destiny was fulfilled to swallow Yonah from the 6 days of creation,and once it had done its mission it was now time for it to die and become a meal to the Leviathan, just as every fish would eventually end up there as well when they achieved their missions, this is what it means בא יומי להאכל בפיו של לויתן - It's my day to be eaten, previous days other fish had their turns but my life was prolonged to swallow you, and the coming days it will be other fishes turns. So Yonah goes to the Leviathan and says you think you're so great? you're being fattened for the slaughter for the great meal of the righteous.
Even the biggest fish were supposed to be eaten by the Leviathan which was colossal in comparison to any fish, as it says Bava Basra 74a:
ההוא כוורא דאפקיה לרישיה מימא והוה ליה קרני וחקיק עליה אנא בריה קלה שבים והוינא תלת מאה פרסי ואזילנא לפומא דלויתן
That fish had written on its horns " I am but a minor creation in the sea 300 parasangs long and my destiny is to go in the mouth of the Leviathan."
Also in Bava Batra 74b its written:
תניא נמי הכי ירדן יוצא ממערת פמייס ומהלך בימה של סיבכי ובימה של טבריא ומתגלגל ויורד לים הגדול ומתגלגל ויורד עד שמגיע לפיו של לויתן שנאמר (איוב מ, כג)הן יעשוק נהר ולא יחפוז" - (פרת שמימיו פרים ורבים והוא נהר גדול עושקו וגוזלו מן הבריות בשתותו) "יבטח כי יגיח ירדן אל פיה"
The Jordan river goes forth from the source in the cave of Pamias, it flows till the sea of Sivchee and it flows more till the see of Teveria the flows further into the great sea which in turn goes deeper and deeper (i.e further into the oceans) until it reaches to the mouth of the leviathan, This is what the verse in Iyov 40,23 means: "The Leviathan takes by force the waters of the Euphrates the massive river, He is secure when the river Jordan feeds (all the fish) into the mouth of the Leviathan."
The Malbim explains that posuk:
הוא הלויתן שנמצא במים וטורף שם כל חיות המים, "הן יעשק נהר", ראה נא שם נמצא בריאה שרוצה לעשוק את כל הנהר עם הבע"ח אשר בו, עצור בעדו "שלא יחפז" לעשק את הנהר, כי הלא "הוא בוטח שיגיח את כל הירדן אל פיהו" וישחית את כל חי הנמצא בו
He steals all the living beings from the river he won't hurry because he knows they will all end up in his mouth and he will consume every living being in that river.
The goal of the fruit from the tree of life was to be eaten by Adam, the fish in the sea were supposed to be eaten by the Livyoson but the purpose of the animals and the birds on land were originally to stay alive to serve Adam who would serve Hashem, and therefore the animals would live forever just like the Adam in order to serve him see Sanhedrin 59b:
תניא רבי שמעון בן מנסיא אומר, חבל על שמש גדול שאבד מן העולם, שאלמלא לא נתקלל נחש, כל אחד ואחד מישראל היו מזדמנין לו שני נחשים טובים, אחד משגרו לצפון ואחד משגרו לדרום להביא לו סנדלבונים טובים ואבנים טובות ומרגליות, ולא עוד אלא שמפשילין רצועה תחת זנבו ומוציא בה עפר לגנתו ולחורבתו
Woe for the biggest servant that we lost for had the snake not sinned, 2 good snakes were supposed to present themselves for each one of the Israelites one sent to the north and one to the south to bring him nice jewels etc.
So fish were never supposed to live forever as their Tachlis was to fatten up the Leviathan for the great feast.