It is correct that the man travels 3.5 km/hr in the first 2 hours and 2km/hr in the next 1 hour. However, averaging out the two speeds to find the average velocity of the entire trip is incorrect. By averaging the two values, you are assuming that the man travelled the two velocities for equal amounts of time, which is not true.
To correctly figure out the problem, you must see the journey as a whole.
Vavg = Δx/t
Since you are asked to find the average velocity of the WHOLE journey, you need to find Δx for the WHOLE journey and t for the WHOLE journey.
Δx = 7km + 2km = 9km
t = 2 hr + 1 hr = 3 hr
Since the man is walking in the same direction, he is essentially walking 9 km (7km+2km) in 3 hours (2km+1km).
Vavg = Δx/t = 9km/3 hr = 3 km/hr
Answer: The average velocity of the whole journey is 3 km/hr.