ggplot(mtcars, aes(x = factor(cyl), y = wt, fill = factor(gear))) +
geom_bar(stat = "identity", position = "dodge") +
geom_line(aes(y = ave(wt, cyl, FUN = max), group = gear)) +
geom_point(aes(y = ave(wt, cyl, FUN = max), group = gear))
При необходимости измените FUN