When I was a UA Reservations Sales Representative (RSR) way back in 1985-87, a lap child cost 10% of an adult fare and was listed in the passenger name record (PNR) as "PLUS INF" (plus infant) after the first name of another passenger.
So there was no way for the baby to accrue miles unless in his or her own seat under his or her own name.
Even if lap children are now listed by name for Transportation Security Administration (TSA) purposes, I don't know whether UA has enabled lifetime mileage accrual on such extraordinarily discounted fares.
I highly suspect not.