Hinduism, like many ancient religious texts and mythologies, often incorporates poetic or metaphorical language to convey spiritual and philosophical concepts. It is important to understand that these texts were not meant to provide scientific explanations but rather to convey moral, spiritual, and cultural teachings.
The story you mentioned from the Ramayana is a mythological narrative and should be understood within its mythological context. In Hindu mythology, gods and celestial beings are often portrayed as having control over various natural phenomena. The specific incident you mentioned involving Ravana and the Sun is a part of the narrative and symbolism of the story rather than an attempt to provide an accurate scientific explanation of celestial mechanics.
It's worth noting that the understanding of astronomical phenomena has evolved significantly over time through scientific observation and inquiry. Modern science has provided us with a better understanding of the Earth's rotation, the movement of celestial bodies, and the heliocentric model, which states that the Earth revolves around the Sun.
Religious texts and mythologies should not be interpreted as scientific textbooks but rather as cultural and spiritual narratives that reflect the beliefs, values, and worldview of the people and times in which they were written. It is important to approach religious and mythological texts with a balanced perspective, appreciating their symbolic and metaphorical nature while acknowledging the advancements in scientific knowledge.