And how did Ienzo and Riku know Replicas can house hearts to begin with? They didn't know the Replicas can grow hearts. Or did Riku know? That would contradict their attitude towards the Nobodies in KH2.
Not a big issue, there are several possibilities.
Lea was restored and conscious at the same time as Ienzo, maybe they talked about it -offscreen- a little at some point before KH3 started. In KH2 Axel was aware Roxas made him feel 'like he had a heart', but he already suspected it in 358/2 days, he even asked Roxas if he was sure they don't have hearts, and in one of that game's secret reports Axel expressed remorse for how he used Riku Replica in Castle Oblivion.
And then, at the end of DDD Xemnas confirmed to Sora that he lied to the nobodies about not having hearts. That's quite important, there's no way Sora didn't mention that to Yen Sid, Riku and the King, and Lea could easily confirm it. Plus Sora felt Roxas's feelings in the dream within a dream.
It's safe to assume that by the time KH3 starts, that information was common knowledge among the good guys. They had a lot to talk about between the end of DDD and the start of KH3, but KH3 was a very lazy game at explaining things.
If Lea didn't tell Ienzo, that leaves Riku and Mickey or Chip and Dale.
If Disney Castle contacted Radiant Garden to collaborate in the computing stuff and decyphering Ansem's code, first of all they would need to exchange info so they knew what they were doing. We don't know who told Ienzo, but it's not that important after all, and at least it makes sense someone told him. This is an easy to forgive issue considering everything else that was poorly explained or exposed in KH3.
Edit: Just now I realized you were talking about Replicas housing hearts, not nobodies growing them. My bad.
When Riku Replica died, he wondered where his heart would go, and Riku guessed it would be the same place as his own. That could make him suspect that Replicas can be filled with or grow hearts.
Axel could have suspected something, too.
And Vexen aimed for creating replicas that could not only duplicate, but replace and be as real as normal people.
Vexen used Riku's memories to create Riku Replica, and hearts are made of memories, which also shape replicas, meaning he not only replicated Riku's body, but also the heart (to some extent, we know a complete recreation through data is not possible). Which makes sense considering Riku Replica thought he was the real one. Then Naminé messed him, but that's irrelevant here.
Vexen liked to brag about his intellect and the replica project prowess in CoM; to some extent Ienzo must have known about what the replica program aimed for, (why Xemnas was so interested in it) and Vexen's own goals, though the only info KH3 Ienzo could salvage was old, before Vexen could achieve anything useful.
You know, in real life scientific papers have a section at the beginning that discuss the goals of an study. It's one of the first things you need in order to conduct an experiment: goals (a purpose, to justify the study), hypothesis (predictions you want to validate or not) and a methodology (the way to carry it out). Documenting every step you take is absolutely necessary in science and Vexen documenting the replica program goals long before he could achieve them suits him. This is much more speculation that fact, but in lack of a better explanation...