APL (Dyalog Unicode), 2828 26 bytes
Saved 2 bytes thanks to Adám!
{⌈/≢¨⍵/⍨(1=≢∘∪)¨⍵⍨1=≢∘∪¨⍵}⊢⊥⍣¯1⍨¨1+⍳ Pretty straightforward implementation.
{⌈/≢¨⍵/⍨(1=≢∘∪)¨⍵}⊢⊥⍣¯1⍨¨1+⍳ 1+⍳ ⍝ Make a range [2, n + 1] ¨ ⍝ For each b in that range ⊢⊥⍣¯1⍨ ⍝ Interpret n in base b (gives a vector of integers) ⍵/⍨ ⍝ Keep the representations where (1=≢∘∪)¨⍵1=≢∘∪¨⍵ ⍝ it's a repdigit ¨⍵ ¨⍵ ⍝ For every representation, ≢∘∪ ≢∘∪ ⍝ is the length of it, without duplicates 1= 1= ⍝ equal to 1? ≢¨ ⍝ Get the length of each of the remaining representations ⌈/ ⍝ Get the biggest length