Ares de Borg... I want to correct my test conclusions to spare you time and trouble...It seemed to work well when I tested it, however after testing again, it will Not prevent the Original Unit from being built unless the "Inbetween Unit" (Docked For Upgrade) is set for the CIVs that you want to have it. When I was testing everything I had some different game settings that caused me to fail to see that the original unit could continue to be built..."Docked For Upgrade" sounds Good but this will all just cause problems because you do not want the Original Unit to be built later Nor the Inbetween Unit to be able to be built at all. Unless the Inbetween Unit is set to be Buildable in the Normal way with the (CIVs Highlighted), it will Not prevent the Original Unit from continuing to be built as it Upgrades to the King Unit.
Virote_Considon is correct and I can say that the correct Place for the King Unit would be the Final Unit used if you wanted to set up and use the Buildable inbetween unit because if the inbetween unit is set as a King Unit, it will not prevent the original unit from being built.
The easiest work around for "Special Units" that are one of a kind is to pre-place them and have them Upgrade to the Unit wanted. In your game situation, this can be set up by pre-placing the one of a kind WW1 Battleships that are set as Immobile and explained in the Civilopedia as under construction or something to that effect. These Immobile Units can then be made Functional by gaining Advances that allow them to Upgrade to Functional WW1 Battleships (same Units but set as additional Units with functional settings). Those Units can then Upgrade again to Modern Battleships with later Advances. This would all prevent Building any of those units and allow them the Upgrades would be King Units that cannot be built.
Upgrades for Many Units should be handled as the Game handles Upgrades...unless you want to make an Improvement or Wonder that will prevent the Unit from being built as they are produced. They will then Upgrade as a King Unit so they cannot be built and the CIVs can be selected that can have them so this shows in the Civilopedia.
Madeira... IF you want the Peasants to be able to be built at the same time as they can be Upgraded to a Settler without causing the Peasants to be obsolete and therefore Not buildable, you can either set them as auto produced as you already know or you can use the "inbetween unit" approach.
1. Peasants - set as buildable, CIVs that can build them are Selected (Highlighted), The Inbetween Upgrade Unit is set in the Upgrade Slot and the Upgrade Box is Checked.
2. The Inbetween Upgrade Unit - No CIV is selected (Not Highlighted) to be able to build them and the Upgrade Box is NOT Checked. Type the Settler Name in the Upgrade Slot and I recommend 0 Cost so the Cost will only show the cost for the Settler. Use the same prerequisite as you want for the Settler Unit so it will Upgrade immediately to the Settler.
Note...You can simply use the same "Peasant" or Settler Unit as the Inbetween Unit, named differently with the different settings. Actually, the "inbetween" unit does not need to make sense because it will not be seen or known about anyway.
3. Set the Settler as a King Unit and check "Settle" under "AI Strategies" and "Build City" and "Join City" under "Worker/Engineer Actions".
Naturally, you can set either the Peasants and or the Settlers to have Offense and or Defense ...or other settings as you prefer.
What you will see in the Civilopedia when you look at the Peasant Unit is that it Upgrades to the Settler. It will Not show the inbetween unit because it was Not Selected (Highlighted) for any CIV. The Peasants will remain Buildable.