Work is the result of a force on a point that moves through a distance. As the point moves, it follows a curve X, with a velocity v, at each instant. The small amount of work δW that occurs over an instant of time dt is calculated as
$\delta W = \mathbf{F}\cdot d\mathbf{s} = \mathbf{F}\cdot\mathbf{v}dt$
where the $F ⋅ v$ is the power over the instant $dt$. The sum of these small amounts of work over the trajectory of the point yields the work,
$W = \int_{t_1}^{t_2}\mathbf{F} \cdot \mathbf{v}dt = \int_{t_1}^{t_2}\mathbf{F} \cdot {\tfrac{d\mathbf{s}}{dt}}dt =\int_C \mathbf{F} \cdot d\mathbf{s}$
where $C$ is the trajectory from $x(t1)$ to $x(t2)$. This integral is computed along the trajectory of the particle, and is therefore said to be path dependent.
If the force is always directed along this line, and the magnitude of the force is $F$, then this integral simplifies to
$W = \int_C F\,ds$
where $s$ is distance along the line. If $F$ is constant, in addition to being directed along the line, then the integral simplifies further to
$W = \int_C F\,ds = F\int_C ds = Fs$
where $s$ is the distance traveled by the point along the line.
In your case you do not say if the force is being applied constantly or not. We only know that is has been applied. Since we don't know if the force has stopped we have to assume at least two cases. The first, the force is being a applied constantly over an indefinite period of time on the block on a frictionless surface and in this case its velocity is accelerating over and infinite time period and then yes the work done that is approaching an infinite quantity. Or second in the case where the force may have been stopped being applied after a certain period of time the block would cease accelerating and continue at a constant velocity. In this case the force would have a definite quantity.
To understand this better lets examine the Work Energy Principle :
The principle of work and kinetic energy (also known as the work–energy principle) states that the work done by all forces acting on a particle (the work of the resultant force) equals the change in the kinetic energy of the particle. That is, the work $W$ done by the resultant force on a particle equals the change in the particle's kinetic energy $E_k$,
$W=\Delta E_k=\tfrac12mv_2^2-\tfrac12mv_1^2$
where $v_1$ and $v_2$ are the speeds of the particle before and after the work is done and $m$ is its mass.
The derivation of the work–energy principle begins with Newton's second law and the resultant force on a particle which includes forces applied to the particle and constraint forces imposed on its movement. Computation of the scalar product of the forces with the velocity of the particle evaluates the instantaneous power added to the system.
For additional edification -
In the general case of rectilinear motion, when the net force F is not constant in magnitude, but is constant in direction, and parallel to the velocity of the particle, the work must be integrated along the path of the particle:
$W = \int_{t_1}^{t_2} \mathbf{F}\cdot \mathbf{v}dt = \int_{t_1}^{t_2} F \,v dt = \int_{t_1}^{t_2} ma \,v dt = m \int_{t_1}^{t_2} v \,{dv \over dt}\,dt = m \int_{v_1}^{v_2} v\,dv = \tfrac12 m (v_2^2 - v_1^2)$
Let's Examine your first statement -
"In physics, a force is said to do work if, when acting on a body, there is a displacement of the point of application in the direction of the force."
This true and for a point in time it is $\delta W$ as described above.
Next you say
"Also work is defined as the product of force and the displacement caused by the force. Now, if a block is kept on a frictionless surface and a force is exerted on it, it will travel indefinitely unless another unbalanced force acts on it."
OK but nothing is said about the time the force is applied. So as you can see we are left with answering a number of cases of time periods and also must cover a number of cases when the force is constant over time and when it is not but in the same direction. Hope the various methods of dealing with the potential cases in point have helped to show you the need for structuring your questions carefully.
And your question -
"Does this mean that the work done is infinite?"
Yes if the force is applied constantly or inconsistently over an infinite time period. No if it was only applied for a definite period of time.
Best Answer
Work done by tension on BOTH the blocks can be regarded as 0. This can be said by the Virtual Work Method.
The virtual work method:
Consider that block 1(mass $2kg$) displaces by a certain $d\vec{s_1}$. Infinitesimal work done on the block 1 by tension will be given by $$dW_1 = \vec T.d\vec s_1=Tds_1\cos\theta_1$$ Similarly, for block 2 we can say that $$dW_2=\vec T.d\vec s_2=Tds_2\cos\theta_2$$
Using string constraint, we can say that displacement of each block along the string is zero(because the string is inextensible). So we get $$ds_1\cos\theta_1+ds_2\cos\theta_2=0$$ Notice that I have used the same $\theta$ for each block as in tension because the direction along the string is the direction along tension vector.
Net work done by tension thus becomes $$dW_T=T(ds_1\cos\theta_1+ds_2\cos\theta_2)$$ $$\therefore dW_T=0$$ $$W_T=0$$
The solution to the actual problem:
If we apply $W=\Delta K$ on the system of the two blocks from initial position to the final position where block 1 is at the bottom of the cicrular arc,we get $$m_1g\Delta h_1+m_2g\Delta h_2=\frac 12 m_1 v_1^2+\frac 12 m_2 v_2^2$$ I do not include work done by tension on the system because i proved it to be 0.
We now need to find a relation between $v_1$ and $v_2$. We can do this by applying string constraint. $$v_1\cos\theta=v_2$$ where $\cos\theta=\frac 35$(by geometry). $$\therefore \frac 35 v_1 = v_2$$ Substituting $v_2$ in terms of $v_1$ in the above equation, we can find $v_1$.
Then applying $W=\Delta K$ on block 1 only we get $$W_T + W_{gravity} = \frac 12 m_1v_1^2$$ Substitute $W_{gravity}$ and $v_1$ in this equation and find $W_T$.