Are you moving out earlier than you were suppose to? Were you suppose to pay your portion through the end of the lease? Are you fulfilling your obligation to your friends? Do you have a written agreement with your friends? Even so, if their lease contract does not allow sub-leases than your written agreement with them is probably not valid because an illegal contract is not enforceable. Check with an attorney.
If it was always known and agreed to that you would move out early and stop paying then plea with your friends to do the right thing and pay you back your portion of the deposit when the deposit is returned to them. If they do not do the right thing then you do have the option of suing in small claims court which does not require an attorneys and attorneys are usually not used for small claims. This is the cheap and best route to go for small amounts of money if you feel the need to sue. You would just want to have your file with all the facts and sequence of events. It sounds like the amount is so mimimal that it would not be worth the time and aggrevation to sue.
If you are leaving the apartment early and not paying your portion which was not your agreement then you are leaving them high and dry. I do not mean to be rude but I would say in that case they would then deserve your portion of the deposit to help cover their financial loss.
In the future, be part of the lease so that you have rights under the lease.
Here are the court locations and phone numbers
Some issues which will determine your success or failure:
Was there any agreement with your other roommates that obligated you to stay in the apt for a specific length of time? If there was no agreement, you are free to go, provided you gave them 30 days notice (do it in writing) and you did not damage the unit.
Also, it is wise to put your request for the deposit to your roommates in writing, mail it certified return receipt requested.
You might also try to get the deposit back from the landlord explaining your situation. It is unlikely the landlord will return your portion of the security deposit, but you lose nothing by asking.
Good luck A.