There are few things that you have mentioned explicitly. While analysing the case, I need to unravel the unstated part.
Firstly, after 10 years also, why are you Team Leader (TL)? Does this designation commensurate to the length of your total service?
Secondly, when an employee is assigned a designation a level below then it is nothing but demotion. What is the cause of this? Do you have strained relations with your Manager? Is your company running short of projects?
The last point arises from the second point. Is demotion a ploy to remove you? Any employee will take demotion to his/her heart. In your case, it is not even demotion but your company has placed you at par with your direct report. Is this attempt to frustrate you? What signal your management wanted to send you? Have you become persona non grata?
Since this is organisation restructuring exercise, has your company demoted few others also? What about promotions? Have they promoted anyone? What about removal? Have they retrenched the staff? Since you are not from HR, you may not know however, HR is known to play mischief of this kind. Transfer to the strange department, unexpressed demotions are the usual tricks that HR is known to play. Out of huff, employee resigns and organisation does not need to "remove" or "terminate" any employee.
You have raised query about filing an harassment/discrimination case against my employer. However, filing civil suit is a long haul. Talk to your HR. If they remain intractable, then you may approach the Labour Officer (LO) of your area. Explain your case. Let us see whether something positive emerges. LO may not entertain your case as some juniors report to you. Nevertheless, sometimes they entertain these cases as well. When you approach, tell him that your company has demoted you though you have not done any misconduct. "Demotion" is a punishment that awarded if the misconduct is proved. Here in your case, neither any domestic enquiry was conducted nor any show cause notice was given. In the guise of "organisational restructuring", they cannot demote you.
Going legal will not help you much.
Talk to the HOD and find out what exactly is going on.
You could have been able to sense things are going in which direction.
This kind of thing does not happen over night normally.
Introspect on professional performance and other areas where you may find need for change/improvement and also a change of job.