To add your badge code to a valid accelerated mobile page (AMP), only a few changes are necessary:
1) Remove the "script" portion of the badge embed, as this will invalidate the AMP page.
2) Change the "img" tag to "amp-img", as per AMP spec.
3) You must specify "height" and "width" attributes in your image tag. These will depend on the proportions/size of your selected badge image.
To test whether your changes result in valid AMP html, you can use this validator tool:
https://validator.ampproject.org