It was initially thought that one baby was in the locker, but police later confirmed two newborn babies were discovered.
A spokesman for prosecutors in Lübeck said police found a bad-smelling package placed in a suitcase in a locker and made the gruesome discovery at around 10am.
It is unclear whether the babies were killed or stillborn.
The spokesman said one of the bodies was a newborn and the other was badly decayed.
Police in Lübeck had already been investigating a 39-year-old woman from nearby Bad Schwartau on suspicion of manslaughter and arrested her on Wednesday.
They then searched her and found the key to the locker in Hamburg’s central train station.
She was brought to the police's attention by a friend who reported her after an appeal on crime watch TV show "Aktenzeichen XY". The appeal, concerning an unrelated case of a dead baby, asked: "Who knows this woman was was pregnant but has no baby?"
But according to the Hamburger Abendblatt, she had been known to police since 2011 in connection with another case.
A baby's body was found in a cemetery in September 2011 in Bad Schwartau and the woman admitted it was hers. She said she had give birth at home but the baby was stillborn.
The woman is now in psychiatric care.
The exact circumstances of the deaths will now be investigated.
SEE ALSO: Seven people injured in acid attack