Many flights to Europe leave Mumbai around 3am so that they arrive first thing in the morning. For example, consider these flights (taken from FlightAware):
Flights to Abu Dhabi, Frankfurt, Paris, Amsterdam, and London leave Mumbai around 3-4am and arrive at their destinations between 6 and 8am (there are also flights to New York, Zurich, Hong Kong, Bangkok, and Munich that leave around 1-2am and arrive early in the morning at these airports. This allows business travelers to have a full day of work at their destination and fly during night hours. It also allows connecting passengers (these are all major hub airports) to arrive at the next airport early in the day, so that they can connect to a wide range of other flights to airports all over the world.
And as you've noticed, flights at more inconvenient times may be cheaper. Airlines wish to maximize their profit for all their flights, and they know that some passengers are willing to pay more for their travel than others. As such, they offer seats at different price points. Some of these are obvious: economy class vs business class vs first class (where available), charging extra for a reserved seat, etc... Some are less obvious: charging less for direct flights (without connections), charging more for last-minute bookings, and charging less for flights that leave at more inconvenient times.
The threat of a terrorist attack is not relevant to departure times.