HICL Infrastructure and The Renewables Infrastructure Group have signed detailed heads of terms on a £5.3 billion merger that would create the UK's largest listed infrastructure company.