I am travelling from Dusseldorf to Delhi and vice versa via Tehran. Airlines is same (Mahan airlines). I will not get out of the airport in Tehran. Do I need a transit visa in Tehran? I am an Indian citizen.
Tehran allow citizens of India to transit airside through the airport without obtaining a visa, as long as the stay is less than 24 hours. Using a Transit-without-visa (TWOV) you will not be allow leave the airside area of the airport.
Interestingly, if you are connecting on a different airline and require bags to be re-checked (something that would normally require passing through immigration), Tehran airport has a free service where they will handle that for you so that you do not need to pass through immigration.
It is also possible to apply for a transit visa on arrival, which allows staying up to 48 hours.
Not directly related to your question, however if you ever intend to visit the US, I would recommend against getting a visa and entering Iran if possible. For citizens of countries that are eligible to use the US Visa Waiver Program, entering Iran will invalidate that eligibility. For an Indian citizen a US visa would be required anyway, but having to list that you have visited Iran may make the process of obtaining that visa more difficult.
Simply transiting through the country should not be an issue, as that is generally not regard as having visited the country.
As stated in Timatic, the database used by airlines:
TWOV (Transit Without Visa): Passengers with a confirmed onward ticket for a flight to a third country within 24 hours
So if the trip is in a single booking, you do not need a visa.
If it's on separate tickets, it is also possible if the transit airport has facilities to transfer your luggage, but the check-in staff at the departure airport may well not be aware of this, and consequently deny you boarding.
If you're on separate tickets, contact the ground handling agent at your departure airport responsible for Mahan airlines and ask for their interpretation of the rules