Train travel is vital for local economies with passengers spending billions of pounds each year, according to new research commissioned by the rail sector.