I have three points $(x_1, y_1),~ (x_2, y_2),~ (x_3, y_3)$ that are on the same line. How to efficiently find which is the point in between.
Also, is there any efficient way to check if 3 random points are on the same line and then find the point in between?

Find three distances and use the fact that the distance between end points is the greatest. You have points $A(x_1,y_1), B(x_2, y_2), C(x_3, y_3)$. The square of distance between $A$ and $B$ is $$(x_1-x_2)^2+(y_1-y_2)^2$$ You can use squared distance to simplify calculations.
To check if three points are on one line, there is a simple formula derived from area of a triangle formed by three points.: $$(y_3-y_1)(x_2-x_1)-(x_3-x_1)(y_2-y_1)$$ This is double of the area. If it's zero, the points are on one line.