It's important to understand what Downstream and Upstream mean here.
Let's assume the Speed of the Boat in Still water to be Sb and the speed of the current to be Sc(which is 4kmph )
⋅Downstream would mean that the current and the boat are moving in the SAME direction . Hence the speed of the current would enhance the speed of the boat and the overall speed would be Sb+Sc
We know that Time=DistanceSpeed
For Downstream it will be
Time(Downstream)=40Sb+Sc=40Sb+4
⋅Upstream would mean that the current and the boat are moving in the OPPOSITE direction . Hence the speed of the current would restrict the speed of the boat and the overall speed would be Sb−Sc
For Upstream it will be
Time(Upstream)=24Sb−Sc=24Sb−4
Time(Downstream)=Time(Upstream)
40Sb+4=24Sb−4
40(Sb−4)=24(Sb+4)
40Sb−160=24Sb+96
40Sb−24Sb=96+160
16Sb=256
Sb=16
The rate of Jai Singh’s boat in still water will be 16kmph