Apart from quests most ships can be unlock by defeating the rebel flagship with the previous ship, what happens if I defeat the damaged rebel flagship in the rebel stronghold sector with (for example) the zoltan cruiser? Will I unlock the mantis cruiser or not?
No, the Flagship Construction does not unlock ships in the same way as beating the finished Flagship at the end of the game. They are two different events (and fights), that do not share the same flags. The flagship construction has it's own explicit event flag, "FLAGSHIP_CONSTRUCTION".
The game most likely ties unlock new ships through beating the game, not from just beating a 3rd phase flagship.
The only ship you will unlock through beating the flagship construction is the Federation Cruiser.