Further investigation of the error into the Hawq logs noticed that the HAWQ Master was trying to copy some folders and files in the folder /data/hawq/master , but since the folder was already populated with some files and folder , the process was expecting this folder to be empty, due to which the Master init failed.
So I backed up the content from the folder /data/hawq/master and emptied the folder. When I tried to install now through Ambari 2.2.2 , it went through and was able to successfully install the HAWQ Services in Ambari and both HAWQ and PXF Services were up and running.