If an environment variable (`HUGO_VERSION` in this case) has the same value for all contexts (production, deploy-preview & branch-deploy), then there is no need to specify it for each context.
Specifying it once under [build.environment] should be enough.
From https://docs.netlify.com/configure-builds/file-based-configuration/#deploy-contexts :
"any property of a context-aware key, such as [build] or [[plugins]], will be applied to all contexts unless the same property key is present in a more specific context."