Trains between Southampton and Portsmouth are either SWT (similar rolling stock as per Waterloo line), Southern (again, same as via London), or FGW (three-carriage cattle truck). Would not recommend riding along from there unless you allow plenty of time and plot your route carefully. A27 is pretty nasty for cycling during peak hours, and Southampton's one-way system is a bit of a navigation nightmare. If you still fancy a ride, a better option would be to leave the train at Eastleigh and go to Pompey via Wickham, Southwick, then down the hill, which is a lot more pleasant.