.. Have they got the same motor?
Other than the label, I believe so. Even the 39 kWh versions have the same motor, derated to 100 kW.
Since these motors use greased sealed ball bearings they will have a finite life and that's becoming evident now in the early Ioniq. Complicating this is that there does seem to be some sort of design issue at the tail bearing end that may or may not have been fixed in the 1 or 2 later versions that both the Kona and Niro received. Anecdotally, there do seem to be less complaints as the later examples age. An EV specialist local to me here in NZ has been repairing Ioniq motors for $NZ1500, essentially just replacing the bearings.
The gear reducer (GRU) seems to be the more common failure in both cars (and the Ioniq) and I believe that's due primarily to the loose internal magnet as it rubs off any wear particles captured. That lack of retention is far more critical during break-in and steel particles ingested by precision bearings will reduce their expected lifetime. The only thing owners can do to help avoid a problem is to change the oil, particularly in the first few weeks. If you happen to get a replacement GRU change the oil after around 300-500 miles. If it's clean, they may have fixed the problem, but no one has reported that yet.
Some have had their GRUs repaired over the years and that has required only bearing replacements.
The gen-2 Niro (2023+ except the Niro 'Plus' model) and Kona (2024+) have a completely new design of both motor and GRU, now more in line with what other major manufacturers are doing. They're fully integrated and the motor runs 'wet'. Oil is drawn through a filter screen in the GRU and pumped to the motor for internal cooling and to lubricate the bearings. I very much doubt there will be any issues with this newer design.