Recently I boarded a flight and noticed outside air temperature as -53°C at an altitude of 36860ft (11.23km). I don't know what causes such a freezing temperature in that altitude but was wondering higher altitudes (space) may have even freezing temperatures. Here I got a doubt i.e what happens if an ice cube is left in space? Would it be melting or stay as it is?
It depends on where in outer space you are.
If you simply stick it in orbit around the Earth, it'll sublimate: the mean surface temperature of something at Earth's distance from the Sun is about 220K, which is solidly in the vapor phase for water in a vacuum, and the solid-vapor transition at that temperature doesn't pass through the liquid phase. On the other hand, if you stick your ice cube out in the Oort Cloud, it'll grow: the mean surface temperature is 40K or below, well into the solid phase, so it'll pick up (or be picked up by) gas and other objects in space.
A comet is a rough approximation to an ice cube. If you think of what happens to a comet at various places, that's about what would happen to your ice cube.
It would sublimate. The frozen mass of water would decrease in size as the water converts from a solid to a gas (without becoming a liquid) and drifts away.
In the vacuum of space the most important consideration is to consider how much radiation an ice cube would absorb from, for example, nearby stars and how fast the ice cube itself would radiate away energy (using Wien's law), finding what ice cube temperature would produce an equilibrium (the temperature at which the ice cube radiate energy at the same rate it absorbed energy) and then determining if that temperature is above or below the melting point of the ice cube. If it is above the melting point (of water in a vacuum), then as the other answers have said the ice cube would sublimate; if it is below the melting point then the ice cube would stay frozen.
Specifically for an ice cube that is a cube in orbit around the sun with one side facing the sun you would need to calculate how much energy the side facing the sun absorbs from the sun as well as how much energy radiates away from all six sides of the cube and then find the equilibrium temperature.