My normal method of securing a battery that can move around, (not a tight fit in place), is to use a strip of velcro which is used to stop the battery from sliding forward or rearward, combined with the use of a velcro cable strap which stops the battery from rolling off of the velcro and also stops the battery lifting up or falling from the velcro during high "G" maneuvers.
When using both I have not had a single battery move in flight or come loose from the plane. The only time I suffer a battery separation issue is when I break my own rule!
Just what works for me!
Have fun!