If mass and energy of universe is constant then what 'thing' does the 'work'?
Lots of things do work. The fact that the mass an energy are constant just tells us that you can't create or destroy it, but you can convert it from one form to another.
The reason that work gets done is because there is an imbalance, from place to place mass and energy (temperature / chemical potential /electrical potential, for instance) are not the same everywhere. Heat flows from hot regions to cold regions - that energy transfer involves work. There are massive objects in some locations and empty space in others; work will be done then things 'fall towards' the massive objects.
If you were to postulate a Universe with uniform density and with uniform temperature (this is a totally pre- Einstein / QM / Olber model so it is nonsense, except in the context of this argument) then nothing could 'happen' because there would be no changes of energy or mass distribution. So you could say that your "thing" is just the differences or ordered-ness of things.
say we have energy 'imbalance' where X>Y, then when after work is being done we shall have total energy of system = (X-Y)/2. now energy is conservred,then what component of energy did the work?
So it's a Whiodunnit, now? HAHA
I don't know if there is a proper answer to this question but I could refer you to a bit of thermodynamics and the theory of heat engines. A heat engine is any system which uses a hot source and a cold sink and extracts mechanical work as heat flows through it from hot to cold via a 'working substance' (steam for example). The Carnot Inequality says that there is a limit to the efficiency - the work you can get out, compared with the energy that has flowed from hot to cold. The limiting efficiency is given by
η < (1-(Tcold/Thot)
See this link.
Where the two temperatures are on the Absolute Scale (Kelvin)
So when you talk of the energy lost from one place and gained in another, that cannot all be used for work, in the case of a temperature difference.
If you are dealing with gravitational potential, the mechanical work you can get out can approach (subject to efficiency) the same as the change in potential. "Which bit did the work?" Is that a meaningful question? It could be said that the process that set up the difference in potential was the thing that did the original work.
Mass and energy
Mass is a bunch of atoms, and inside atoms are particles. Mass is a generalization of these particles that we physicists are constantly trying to understand better and in more detail. These particles can also behave like light waves. This is the ultimate question; do these particles behave really like waves also? In order to understand this concept well, you must understand the 3 laws of thermodynamics.
1. Conservation of energy - energy merely changes from kinetic energy, heat energy, and work energy.
2. Heat flows like diffusion from an area of high amount of particles to an area of low amount of particles
3. Perfect crystalline structures can occur when you approach absolute zero, -273 degrees Celsius.
Separate names with a comma.