Prathamesh -
I don't know the reason, but I think that the args.hdf (along with args.hdr and args.ftr) parameters do not modify the top-most file (the index.html file in your case, the Eclipse help TOC file, and so on) that includes the content, but only the lower-level "topic" files. Someone who better understands the processing architecture would have to explain the why/how for this ... and if there is a way around it.
It looks like your index.html file is a table of contents for your project. If the embedded JS is important for this file, you could create a manual TOC using <xref> elements to each topic. This manual TOC would be a child DITA file of the top-level ditamap, and thus should get the <script> tag from the args.hdf parameter when converted to HTML5. Then, I think you won't need the generated index.html file anymore.
-- Michael