Factories should increase your production of ships and other planetary improvements. The reason you may not see a change is because of the spending slider you have for military production. If its very low, the additional production from a factory may not make a difference. However you state that the build time increased. The only thing i can think right now that might cause that is that you are very early in the game such that your economy is practically nonexistant (this is true for everyone). In this case the added cost of maintenance for the factory may well have been just enough to lower your overall income, this will leave less money to go toward production even if you didnt change the slider. Also note thart if its an extremem world your production is already halfed.
As you have a greater populatuion and more planets, your increase in revenue will outweigh the increase in maintenance costs, if you are careful. This is critical early in the game to not overbuild. Later in the game you will also not see a dcecrease in build time because even if you have less income that turn, it probably wont be enough to change the construct time. There are times where I will build over a factory type building with a stck exchange very late in the ghame and actually see a reduction in build time, I assume that its because of the increase in revenue on a fully populated planet.
Keep playing and see if you have the same thing happen after your empire has settled.