Vinay,
The problem is the lazy loading of layers. It sounds like one of yours is just taking longer to load so it is loading later.
You have two options
1. Add the map layers together with addLayers([0,1]) instead of adding one at a time. This will guarantee the order.
2. Specify an index value when you add the layer.
i.e
addLayer(top layer)
addLayer(bottom layer, 0) forcing it to the bottom
-Jeff