Riley finished ninth in the 14-15 age group and Bayley finished eighth in the 16-17.
The top 200 teens in each age group were invited to compete in a further online qualifier which included four workouts and took into account where they finished in the open.
The top 20 in each age group were then eligible to compete at the CrossFit Games in Madison, Wisconsin in August.
Riley and Bayley finished 13th and ninth respectively to book their tickets to America.
"It's pretty exciting and we're ready for the experience and atmosphere of competing," said Riley.
The boys started CrossFit in 2014 and use their competitiveness with each other as motivation to work hard.
"He's not too bad if he loses to me, but I hate it if I lose," said Bayley.
"It helps with training because if I didn't have him I wouldn't be pushing as hard - we can work off each other."
Riley said: "I'm always trying to catch him and he's always trying to stay ahead, it's never-ending."
Competing at the highest level runs in the family as the boys' father, who got them into CrossFit, is former New Zealand sevens rugby player Ross Martin."Dad got us into [CrossFit]," said Riley.
"It was good for me because I like fitness - after about a year of doing a couple of days a week we got more serious and started training hard."
In preparation for the games, in which they will complete 15 workouts over four days, the boys are training three times a day.
Bayley said he enjoyed CrossFit because it gave him the opportunity to test himself and do things that not every other teen could do.
While Bayley excels at gymnastic movements such as pull-ups and muscle-ups, Riley is more of a weightlifter.
"We're trying to get a games feeling in our training at the moment, it's going to be hot over there.
"With so many events over four days we have to try and get used to working out while we are sore," said Riley.
"We try and keep all our layers of clothes on when we're training so we can get used to being hot," said Bayley.
They were looking forward to the opportunity to compete against the best as well as watch, and hopefully meet, the professional senior athletes.
When asked what their goals were for the games, Bayley and Riley were quick to say "stand on the podium".