It might not be illegal to keep it, but I personally would return the ticket to its rightful owner, assuming he or she could provide proof of ownership of the ticket.
This morning I made a photocopy of my transit pass to fax in for
the Transit Reimbursement plan (it allows us to use pretax dollars to pay for transit expensses up to $100 per month).
I had a lot on my mind, and left the pass on the copier with the lid down.
The pass cost me $155 and with January just having started, losing it would obviously not be good.
Luckily a colleague who knew me and knew where I lived, found the pass on the copier (I hadn't even had a chance to write my name and phone number on the back) and returned it to me at my desk hours later.