Bone index change after parenting
No, you can't preserve bone indices, outside of edit-mode, bones are order by their hierarchy.

Its best to reference bones by name rather then index, (Or at least get their index once, outside of edit-mode)