Without knowing a lot more about the relationship between the 'employee' and his agency and based solely on the limited information in your post, it appears to me that the realtor is responsible for the missing money.
This is under the assumption that you were not advised, or aware, of any limitations to his employment or status with the firm. Additionally, it is assumed that you contacted him/her at the office, they had all the 'trappings' of an employee and was acting as an employee.
My questions to the realtor:
1) If he was only 'in training', why was he not under the close supervision of a 'real' employee?
2) At what time did the realtor advise you (if at all) that he/she wasn't a 'real' employee and was not acting on behalf of the realtor?
3) Since he/she was, in all apppearances, an employee of the realtor, it was incumbent on THEM to advise you that he/she was without authorization.
4) And most telling, if you had entered into a lease with the 'in training' and you had decided to breach the lease, would the realtor have 'let you off' since he was just 'in training'??? (I don't think so).
I would write the realtor a letter (certified RRR) and advise that you expect a full refund or a deposit funded within 5 business days from receipt, or you would be forced to take legal action and to file a complaint with the state Board of Realtors.