Let me emphasize (again) that submarine construction does not simply mean using the steel etc freed up by not building something else and using those materials and workmen to now make submarines. Submarine construction, even of 1930s designs, requires very particular skills and techniques. Standards are much higher for submarines than surface ships. Errors in construction that would cause nuisances on surface ships, even smaller ones, could easily become life threatening on a submarine or guarantee the loss of the boat. A building slip that can accommodate a 250 meter long capital ship cannot simply have three 75 meter long submarines constructed there without some major alterations.
To build anything you need to have the proper facilities and the proper correctly trained work force before the first bit of raw material enters the production stream. The USA had a huge automotive industry, a huge steel industry - this did not mean that on December 8 automotive factories would take the resources used to turn out cars and be producing tanks. Did this happen, yes but not overnight. If you look at data for production rates for shipyards that started building submarines from zero in the USA, you see how it took time to start production and how there was a learning curve to actually make the submarines and this was in an environment which was much less resource constrained for material and personnel than Germany.
Even if you assume 1 ton of surface warship not built= 1 ton of submarine built (which is grossly incorrect), there is a lag from making this decision to implementation and a lag from early slow construction to serious series production. While it is obvious that when you have limits on resources of any sort shifting from one use to another will result in less of A and more of B there is not a one for one concordance (one ton less of A equals one ton more of B) and there is a lag where production facilities are expanded to make more of B (and workers found/trained). You get closest to 1:1 if you look at very similar items - for example trading off single engine aircraft for multi-engine aircraft, battleships for aircraft carriers, and so forth. The more dissimilar items are, like battleships for tanks, the more a ton for ton comparison is inaccurate.