The attack happened at about 23:20 BST on Saturday, on a disused railway near the junction of Tulip Street and Beza Road in Hunslet, West Yorkshire Police said.
Mark Wilkinson, of East Grange Court in Belle Isle appeared before magistrates in Leeds and was remanded in custody.
He is due to appear at Leeds Crown Court on 30 June.
A 27-year-old man has appeared in court charged with raping a 54-year-old woman.