Pacemakers for infants are usually implanted after the child reaches a safe weight though the diagnosis is done before birth.

If the pacemakers are to be implanted before delivery the generator unit has to remain outside the child’s body that can be easily dislodged or infected creating its own problems due to the freely running leads.
The researchers have conducted pre-clinical testing of the device and believe it is ready for use in human trials. The FDA certified the pacemaker as a Humanitarian Use Device and initial implantations are expected in the near future.
Source-Medindia