If it takes 20 years to get cancer, and a parent smokes next to her new baby, can the baby have lung cancer by age 20 years?

1+1 not always 2. While we know a lot about risk factors for cancer, we really cannot predict when cancer will develop based upon exposure to known carcinogens. To be fair, it is unlikely to see lung cancer in a 20 yr old, but there is absolutely no reason why any mother should ever smoke anywhere near her baby, ever.
No. Smoking is a dose effect risk. The longer and more you smoke the greater the chances for lung cancer. Casual second hand smoke over many years is still dangerous but the situation you described is not harmful. It will be if e mom continues to smoke around children.