You were on track. The ties.method of 'average' still runs into duplication. However, using ties.method 'first' will sort and then split. I threw in numbers at the beginning of your vector to make sure this worked out.
library(tidyverse)
df <- tibble( x = c(5,3,1,2,2,3,3,3,3,4,4,5))
n_groups = 3
#included just to see the difference
rank(df$x, ties.method = 'average')
rank(df$x, ties.method = 'first')
df%>%
mutate(grouping = cut(rank(x, ties.method = 'first', na.last = 'keep')
, breaks = n_group
, labels = FALSE))