i) As we conclude from the figure (given below) that to cross diagonally one has to cross n1-1 roads N-S and n2-1 roads from E-W. So he has to select n1-1 roads N-S from n1+n2-2 and n2-1 roads E-W from n1+n2-2 so the required ways are
(n1+n2-2 Cn1-1 )* (n1+n2-2 Cn2-1 ) ways
ii) as indicated in the figure, it is clear that the longest distance can be covered only by two ways either starts with N-S direction or with E-W direction and depend on the length of n1 and n2 roads.
Suppose x is the side of a small rectangle in N-S direction and y is the length of the side of a rectangle in E-W direction then from the figure you can observe that one has to move 20 steps in N-S direction and 5 steps in E-W direction so total distance covered by him is 20x+5y (2 ways are possible and marked in the figure in different colors) but if starts his journey from E-W direction than he has to travel 25 steps in E-W direction and only 4 steps in N-S direction so distance travel by him 4x + 25 y so the distance traveled is depends on length of roads of N1 and N2 (there are again 2 ways possible to travel in this method, left for you imagination).