I found a hack. The purpose of unloading the package was to avoid conflicts. There is a way to do that. Every package file begins with the statement of the Context. See here.
BeginPackage["square`"];
Here, 'square' is the context. Since we have two similar packages containing functions with the common names, what we first have to do is to keep the context names different. For example, if the first package file begins with
BeginPackage["square`"];
then the second package must begin differently, say
BeginPackage["square2`"];
So now, we have created two different contexts which will help us delineate between the two packages. Let's say there is a function with the common name 'func' in both the packages. Here is how I will use func
square`func[....]
square2`func[....]
The first (second) line invokes the func function from the first (second) package.