As a teenager, Hirayama attended Kunimi High School in Nagasaki Prefecture.
There, he won the All Japan High School Soccer Tournament in all years bar 2002.
He made his professional debut with Heracles on 20 August 2005 against ADO Den Haag, playing 15 minutes and scoring 2 goals.
On 4 September 2006, after the transfer period ended Heracles Almelo announced that Hirayama left the club by mutual consent and after being released he returned to Japan to finish his study.
In 2003, Hirayama played for Japan U-20 national team in the 2003 World Youth Championship as a 17-year-old and scored two goals, including the game winner against Egypt to put Japan through to the knockout stage.
His debut for the senior team came on 6 January 2010 in a 2011 Asian Cup qualification against Yemen, and would be a game he would never forget.