How can I run a script as administrator inside a Windows container

Your problem is not insufficient rights at all. See this article.

UAC is not available in Server Core, since it is a command line only interface, doesn’t have IE, or support for user applications. In addition, to use UAC with the command prompt you need to have the Explorer Shell so that you can click Start, right click on Command Prompt, and select run as administrator, which obviously isn’t possible on Server Core.

You are already running commands as an administrator, otherwise commands like

net user administrator Pa$$w0rd

would fail inevitably.

Your problem is something else.

Windows Server Core is not supported for installing WDK. About setting environment variables on Server Core see this answer.

You should take a look at that script and what it actually does, if it uses SET or SETX commands or something else and there you can find a clue why the variables are not being set properly. It might be that they are set permanently but not in your current window.