If you're just after the first achievement for that particular game, you could use this hack:
$firstAchievement = reset($data->RecentAchievements->$gameid);
$title = $firstAchievement->Title;
The API is probably giving you a JSON response, so you may also want to consider this:
$data = json_decode($response, true);
^^^^
The second parameter true
turns the JavaScript objects into PHP arrays, which in most cases makes it easier to handle them, e.g.
$firstAchievement = reset($data['RecentAchievements'][$gameid]);
$title = $firstAchievement['Title'];