Really interesting question, it depends what you want to achieve, the "age is just a number and state of mind" thing is a great attitude but science has a lot to say about the age that physical characteristics start to decline, things like testosterone levels, reaction time, agility, coordination, stamina and strength and recovery time all go the wrong way sooner or later, all though no doubt the more active you stay the better. Comparable sports such as gymnastics and sprinting have very different ages for peak performance, gymasts tend to be teenagers, and sprinters don't necessarily peak until around 30.
Sports where experience is a factor such as martial arts have a later peaking age and competition trials is similar in that sense. In terms of competition riders, Mark Caisso had IMO his stronger year ever this year at age 29, and Benito Ros and Dani Comas are the same age and it'd be harsh to say they're past their best. I've been considering lately what I can realistically hope to achieve at competition riding turning 25 this summer and I'm hoping I've got 5 youthful years left before age becomes an issue.
I would say at 27 you should be bang in your athletic prime and getting back into riding would be a great idea. I love trials and I'll be gutted if my knees don't hold up until I'm at least 40, even if by then it's just for fun and fresh air. I bumped into Martyn Ashton the other week and he's still going strong, I didn't ask how old he is pretty sure it's still double figures... he looks extremely well!