The issue was caused by a hung up javaw.exe which is normally used by ArcGIS Server. This javaw.exe process started working independently of the ArcGIS Server and using port 4000. That was the reason for the error "Failed to start the server machine ''. Error while starting AppServer. Required port '4000' already in use."
To resolve the issue followed the below steps:-
- Stop ArcGIS Server Service which terminates all the ArcGIS Server related processes and restart the service.
- If you found and hung up javaw.exe process running from Windows Task Manager > Processes tab. Terminate the javaw.exe process manually from Task Manager and start the ArcGIS Server Service from Windows services panel.
Hope this helps!