An eight-month-old baby and two toddlers, aged 14 months and 18 months, are in a serious condition in hospital after their pram was hit by a runaway trailer and "pinned against a wall" in Dumfries.