The current speed of a river is 4km/h, and the speed of this ship is 20km/h when the current in the channel is still.
The speed of this ship sailing against the current is 20km/h-4km/h =16km/h,
The sailing distance of a ship is 40 kilometers.
∴ Time for the ship to sail 40km upstream = 40km/(16km/h) = 2.5h.
The option is about 2 hours and 30 minutes.