Another option (based in Tidyverse) is to use the fantastic case_when() function to specify a new column called new_age_range. The case_when() function tests to see whether age_range contains either "25-39" or "40-59" and if it does it recodes this as "25-59". If the age_range column does not contain these values then it simply returns their original value.
age_data <- tibble(age_range = c("18-24", "25-39", "40-59", "60+"))
age_data %>%
mutate(new_age_range = case_when(age_range %in% c("25-39", "40-59") ~ "25-59",
TRUE ~ age_range))
The case_when() works by testing the expression to the left of the ~ sign. If the first expression is true, then it assigns the value to the right of the ~ sign. If it is false, then it evaluates the next expression, and so on. The benefit of this method is that when you have a lot of nested ifelse() statements, you can substitute them with a single case_when() function.