Let r be the internal resistance of each cell.

In above shown figure, first represents the series connection of cells. Second and third figures represents the parallel connection of cells.
Now, in case of series connection, ϵnet=2ϵandrnet=2r. So, current i=5+2r2ϵ .....(1)
In case of parallel connection, ϵnet=r+rϵr+ϵr=ϵandrnet=2r. So, current i=2r+5ϵ .....(2)
Equating (1) and (2), we get
5+2r2ϵ=2r+5ϵ
⇒r+10=5+2r
⇒r=5Ω.