With that you might end up with infinite feedback loop. Say you start with three colony ships and one freighter. As the ships get older chances are the colony ships will be replaced while the freighter will not be. Which leads to a bunch of fast colony ships (as you get engine upgrades) and one slow freighter. Since the colony ships are faster they do more runs which gives them higher earnings while the freighter has lower because it can't keep up. Keep in mind the previous was closer to an extreme just to better show the argument.
Also the problem with your math is that would trend toward newer faster ships being built because if you have a ship that has a total earning of 30,000 but has been in service for 3 years and a ship that has 11,000 total earning with only 1 year service the ship with one year will be built. The problem with that is the 11,000 ship might have more because of faster speeds or maybe a new colony was made next to an old one and so there was plenty of time for the new ship to do a ton of short colonist trips to get the new colony up to 25 million. I would suggest instead of dividing by time in service you might want to divide by (some number) - years in service. That would tend toward replacing older ships with more than one replacement and just have a check when the replacement is built to see if there is a similar class that is faster and/or more range and/or has similar to greater cargo capacity.
I think you're missing both the point and a couple of key ideas about my proposal. The point is that the system for evaluating civilian ship purchases makes decisions untroubled by any hint of economic reality, producing results that are frustrating to the player. I can use three examples to illustrate this. First, take colonizing Mars in a Solar System start. Normally, I've found that the civilians produce more colony ships than they need, while their freighters work constantly. A real businessman would obviously build more freighters, but the game doesn't. This slows down colonization, soaks up money from the shipping lines, and reduces the player's revenue. Second, your scenario, which would have to involve a close colony with little or no colonization cost. In this case, the shipping lines would and should build more colony ships and less freighters. Third, in my most recent game I SMd a starting system with 5 developed planets. Freighters were making a run every few days, while colony ships might get in one payload a month. Obviously, accountants would buy freighters and nothing else.
I can see where you're coming from, but the implementation would be slightly different than you see it. This would be a bias to the ships bought, not a wholesale replacement for the current system, at maybe a 50/50 mix of the two. So there would still be some of everything built, even if it's not terribly profitable (for gameplay, if nothing else). Second, it wouldn't be a case of "pick whatever made the most money over the last year, and buy it". You would probably weight the random selection by the relative income over the period. So if your average freighter made 1100 and your average colony ship 900, the game would pick the freighter 55% of the time. Obviously, this isn't a huge difference, and the model would only really come into play when there is a gross imbalance between the earnings of the two types. That is exactly as intended. Third, the idea of an infinite feedback loop assumes that there is no feedback from the environment the ships are working in. For three fast colony ships to make lots of money, there would need to be somewhere to send the colonists, and to keep sending them over the long term. For them to gain an advantage over freighters, they would need to have a destination that has a low colony cost. Otherwise, they'd sit idle, while waiting for the freighter to carry the infrastructure.
I know there are flaws in my model. It's not perfect, and it might need to be farther modified by the relative build costs of the various types of ships. That said, what I mostly want is a way of tailoring the merchant fleet more closely to individual game conditions. I think this is the best reasonably simple automatic way of doing so, although allowing the player to manually bias the decision would also work.