The concept of an “ancient” era and a “medieval” era followed by modern era evolved in Europe during the Renaissance and enlightenment periods. The scholars at that time looked highly upon the Roman empire and bemoaned its collapse and what followed was termed the “dark ages”. The time between the collapse of the Western Roman empire in 5th century AD and the Renaissance around 1500 AD was termed the middle ages. While the collapse of a civilisation across Europe is indeed sad and the categorisation of middle ages and ancient age may be good for Europe the same cannot be said for the rest of the world. The distinction between bronze age and beginning or iron age in late 2nd millennium BC is a better grounded one. The best distinction is before a culture evolves into a 'civilisation' and after it.
Coming to India scholars here too have classified the time until the collapse of the Gupta empire in 6th century AD as “ancient”and the time after that as “medieval”. But does this make any sense? The categorisation was done only so that it can match that of Europe. There was not any population decline or decline of civilisation in India. Trade and urban centres declined for some time. But Europe suffered the black death in 14th century AD when half the population was wiped out. Even such a catastrophe does not warrant any different categorisation of the time period after that. Then why do we categorise the time up-to the Guptas as ancient and what follows as medieval. We have the same culture, same civilisation. There were still empires and kingdoms. The rural economy and agriculture kept flourishing. Important religious and cultural movements continued to exist.
Why not put the demarcation at the time of Ashoka? After all much of the village structure and the structure of the state and even the linguistic and ethnic borders came to be standardised or fixed by this time. If we observe Indian history, around 1000 BC civilisation started emerging in the Gangetic plain and by the time of Ashoka's death in late 3rd century BC it spread across the subcontinent and also advanced considerably. Thereafter we see a continuous and flourishing civilisation with occasional declines and increases in population and trade but the overall pattern was of continuous increase and development albeit slowly. There is no reason to categorise Indian history as ancient and medieval.
The same applies to the middle-east. There is no need for any arbitrary “ancient” and “medieval” distinction. The less said of China the better. Civilisation continuously existed there for more than 4000 years starting at bronze age with little sophistication and low agricultural surplus up until the very large and very populous Qing dynasty which ended in 1911. We can categorise the age after the Qin dynasty when Qin Shi Huang unified China as Chinese middle ages or the imperial age or feudal age. But in no way can we shift the start of Chinese middle ages to the Tang empire just to match it with that of Europe.
In fact coming back to Europe we have a very important observation. While in China and India the civilisation that started in the northern river valleys (Ganga in India and Yangtze in China) spread across those subcontinents and even though empires collapsed like the Mauryan or the Han the culture and civilisation and religion continued and flourished. But in the case of Europe the Roman empire failed not only to spread itself politically across Europe it could not even culturally unify the rest of Europe. While Indian culture which emerged in the Gangetic valley spread across the subcontinent including the peninsula and then spread beyond across South East Asia and even East Asia, the remnants of which can still be seen now, The Roman culture only spread in regions which they conquered. Although the geography of Europe is an important reason it also maybe because of the sheer brutality with which the Romans destroyed others like they did to the Celtic culture or Carthange. They did not absorb much culture from the Celts did they? They couldn't repeat the same with the Germanic or Slavic peoples who ultimately replaced Roman culture.
All in all the Roman empire existed in large form for hardly 6 centuries. During the time of Alexander's death and when Ashoka ascended to the Throne ruling most of the Indian subcontinent Rome was but a small city state in Italian peninsula. Over the next three centuries it conquered much territory and reached its final size. Over the next four centuries of the common era the Roman empire not only failed to expand physically but also culturally. They could not influence the Germanic or Slavic peoples with their advanced culture which is a big failure. We have to accept that the Roman empire, advanced though it was for its time stagnated after Augustus' time. No major improvements in anything. Until it finally decayed and got destroyed in Europe, although Eastern Roman empire survived in the Middle East.
If not destroyed by the Romans the Celts may have developed a complex literate civilisation soon after. The Germanic and Slavic people certainly did. We only bemoan the collapse of Rome in Europe. But we fail to observe how the rest of Europe, in what is called the dark ages, actually advanced to the stage of a literate civilisation. Be it modern Germany, Poland or Eastern Europe or Scotland or Ireland.
Compared to the 6 or 7 centuries of Rome we see that Iron age cultures existed in Europe since 1000 BCE and bronze age cultures much before that.
From all these we can conclude that the distinction between ancient and medieval is pretty small in the grand scheme of things and not at all applicable outside of Europe.