A paedophile who targeted two children in "near-sadistic" attacks has been jailed for more than 25 years.