Update Nov. 23, 2024
I have continued my experiments and I believe I have found a method to calculate the "phase"-transition points for the parameter $a$, and have - in view of the seeming complexity of the problem suprisingly - obtained an "almost" analytic solution.
The solution
The solution can be given in terms of a simple function the domain of which is determined by a set of numerically determined global transition constants.
Here I present just the solution leaving explanations for later.
Recall that defining the sum
$$s(a,n,\{p\}) = \sum_{i=1}^{n} p_{i}^{(1-p_{i})^a} \tag{1}$$
where $a>0$ is a real parameter and $p_{i}\in [0,1]$ are probabilities subject to $\sum_{i=1}^{n} p_{i}=1 $ we are looking, for given $n$ and $a$, for the maximum $s_{max}$ of $s$ over all possible sets $\{p\}=\{p_{1}, p_{2}, \cdots , p_{n}\}$.
Now for $k\ge 2$ define the set of functions
$$f(k,a)=k^{1-\left(1-\frac{1}{k}\right)^a}\tag{2}$$
then the solution is given by
$$s_{max}(n,a)=max(f(2,a), f(3,a), \cdots, f(n,a))\\
= \max \left(2^{1-\left(\frac{1}{2}\right)^{a}},3^{1-\left(\frac{2}{3}\right)^a},\cdots,n^{1-\left(\frac{n-1}{n}\right)^a}\right) \tag{3}$$
This can be made more explicit by calculating first the set of transition points $a_t(k)$ between each two adjacent functions $f(k,a)$ defined by the solution of the equation
$$f(k,a_t(k))=f(k+1, a_t(k))\tag{4}$$
This equation can be solved iteratively starting with the inial value $a_t(k) = 2k$.
The first 10 values, starting at $k=2$, are
$$a_{t}(k=2..10)=\{0.553953,2.13996,3.87677,5.72384,\\
7.65616,9.65727,11.7156,13.8228,15.9724\}\tag{5}$$
Then we can write $s_{max}$ as this piecewise function
$$s_{max}(n,a) = \text{IF } a\in (a_t(k),a_t(k+1)) \text{ THEN} f(k,a) \tag{6}$$
Note that $s_{max}(n,a)$ is a continuous function of $a$ but it is not smooth, i.e. its derivative is not continuous but has (finite) jumps at the transition points.
Example solutions
The general behaviour of the solution can be described as follows, also illustrated by the simulations:
For $n \gt2$ and very small $a$ the maximum is $a_{max}(n,a)=f(2,a)$ corresponding to the probability set
$\{p\} = \{\frac{1}{2},\frac{1}{2}, 0,\cdots,0\}$, when a grows beyond the transition point $a_t(2)$ the maximum becomes $a_{max}(n,a)=f(3,a)$ corresponding to the set $\{p\} = \{\frac{1}{3},\frac{1}{3}, \frac{1}{3}, 0, \cdots,0\}$, and so on up to $a_t(n-1)<a<a_t(n)$ where $a_{max}(n,a)=f(n-1,a)$ with $\{p\} = \{\frac{1}{n-1},\cdots,\frac{1}{n-1},0\}$ and, finally, for $a>a_t(n)$ where $a_{max}(n,a)=f(n,a)$ with $\{p\} = \{\frac{1}{n},\cdots,\frac{1}{n}\}$.
(Examples and graphs $s_{max}(a)$ to be done)
Original post
In order to get an overwiew of the solutions I have carried out some Monte-Carlo simulations and found an interesting phase transition like behaviour.
Let us rephrase the problem. Define the sum
$$s(a,n,\{p\}) = \sum_{i=1}^{n} p_{i}^{(1-p_{i})^a} \tag{1}$$
where $a>0$ is a real parameter and $p_{i}\in [0,1]$ are probabilities subject to $\sum_{i=1}^{n} p_{i}=1 $.
For given $n$ and $a$ we are looking for the maximum $s_{max}$ of $s$ over all possible sets $\{p\}=\{p_{1}, p_{2}, \cdots , p_{n}\}$.
Monte Carlo pseudo code
In order to find the maximum for given parameter $a$ we set up a Monte-Carlo simulation in the following loop
10 max = 0
20 get a set of $n$ random probabilities $\{p\}$ as defined above
30 calculate s
40 If s>max then (max = s; $\{p\}_{max} = \{p\}$)
50 goto 20
The loop is carried out a certain number $r$ of times until the maximum approaches a constant value.
Notice that we obtain not only the value of the maxiumum but - and this is even more interesting - the set of probabilities leading to that maximum.
Results
Results of a preliminary study are
For given $n= 2 .. 7$ and for $a=\{0.1, 1, 10\}$ we calculate the maximum of $s$ ad depict the set of probabilities corresponding to that value.
Actually, for the time beeing I found it more interesting to study the structure of the peobability sets than the maximum (which I shall provide soon).
All values (except for n=2) of the probabilities are approximated by simple rationals in order to exhibit the structure of the set more clearly.
We can see that, with varying $a$, there are interesting transistions in the structure of the probability sets. These remind (me) of phase transistions.
This should be studies in more depth but the available results already seem to be interesting.
$n=2$ ($r = 10^5$)
$a=0.1$ -> $\{p\} =$ {$\frac {1}{2}$,$\frac {1}{2}$}
$a=1.0$ -> $\{p\} =$ {$\frac {1}{2}$,$\frac {1}{2}$}
$a=10$ -> $\{p\} =$ {$\frac {1}{2}$,$\frac {1}{2}$}
$n=3$ ($r = 10^5$)
$a=0.1$ -> $\{p\} =$ {$\frac {1}{2}$,$\frac {1}{2}$,$0$}
$a=0.55$ -> $\{p\} =$ {$\frac {1}{2}$,$\frac {1}{2}$,$0$}
$a=0.56$ -> $\{p\} =$ {$\frac {1}{3}$,$\frac {1}{3}$,$\frac {1}{3}$}
$a=1.0$ -> $\{p\} =$ {$\frac {1}{3}$,$\frac {1}{3}$,$\frac {1}{3}$}
$a=10$ -> $\{p\} =$ {$\frac {1}{3}$,$\frac {1}{3}$,$\frac {1}{3}$}
$n=4$ ($r = 10^5$)
$a=0.1$ -> $\{p\} \simeq$ {$\frac {1}{2}$,$\frac {1}{2}$,$0$,$0$}
$a=0.55$ -> $\{p\} =$ {$\frac {1}{2}$,$\frac {1}{2}$,$0$,$0$}
$a=0.56$ -> $\{p\} =$ {$\frac {1}{3}$,$\frac {1}{3}$,$\frac {1}{3}$,$0$}
$a=1.0$ -> $\{p\} =$ {$\frac {1}{3}$,$\frac {1}{3}$,$\frac {1}{3}$,$0$}
$a=2.1$ -> $\{p\} =$ {$\frac {1}{3}$,$\frac {1}{3}$,$\frac {1}{3}$,$0$}
$a=2.2$ -> $\{p\} =$ {$\frac {1}{4}$,$\frac {1}{4}$,$\frac {1}{4}$,$\frac {1}{4}$}
$a=10$ -> $\{p\} =$ {$\frac {1}{4}$,$\frac {1}{4}$,$\frac {1}{4}$,$\frac {1}{4}$}
$n = 5$ ($r = 10^5$)
$a = 0.1$ -> $\{p\} =$ {$\frac {1}{2}$,$\frac {1}{2}$,$0$,$0$,$0$}
$a = 0.47$ -> $\{p\} =$ {$\frac {1}{2}$,$\frac {1}{2}$,$0$,$0$,$0$}
$a = 0.48$ -> $\{p\} =$ {$\frac {1}{3}$,$\frac {1}{3}$,$\frac {1}{3}$,$0$,$0$}
$a = 1.0$ -> $\{p\} =$ {$\frac {1}{3}$,$\frac {1}{3}$,$\frac {1}{3}$,$0$,$0$}
$a = 3.7$ -> $\{p\} =$ {$\frac {1}{3}$,$\frac {1}{3}$,$\frac {1}{3}$,$0$,$0$}
$a = 3.8$ -> $\{p\} =$ = {$\frac {1}{5}$,$\frac {1}{5}$,$\frac {1}{5}$,$\frac {1}{5}$,$\frac {1}{5}$}
$a = 10$ -> $\{p\} =$ = {$\frac {1}{5}$,$\frac {1}{5}$,$\frac {1}{5}$,$\frac {1}{5}$,$\frac {1}{5}$}
$n = 6$ ($r = 10^5$)
$a = 0.1$ -> $\{p\} =$ {$\frac {1}{2}$,$\frac {1}{2}$,$0$,$0$,$0$,$0$}
$a = 1.0$ -> $\{p\} =$ {$\frac {1}{3}$,$\frac {1}{3}$,$\frac {1}{3}$,$0$,$0$,$0$}
$a = 10$ -> $\{p\} =$ {$\frac {1}{6}$,$\frac {1}{6}$,$\frac {1}{6}$,$\frac {1}{6}$,$\frac {1}{6}$,$\frac {1}{6}$}}
$n = 7$ ($r = 10^5$)
$a = 0.1$ -> $\{p\} =$ {$\frac {1}{2}$,$\frac {1}{2}$,$0$,$0$,$0$,$0$,$0$}
$a = 1.0$ -> $\{p\} =$ {$\frac {1}{3}$,$\frac {1}{3}$,$\frac {1}{3}$,$0$,$0$,$0$,$0$}
$a = 10$ -> $\{p\} =$ {$\frac {1}{7}$,$\frac {1}{7}$,$\frac {1}{7}$,$\frac {1}{7}$,$\frac {1}{7}$,$\frac {1}{7}$,$\frac {1}{7}$}