What are RAM , ROM and their types used in Motorola smartphone? Well I know some basic information about RAM and ROM. 

RAM is Random Access Memory with two main types i.e. SRAM and DRAM. 

Whereas ROM is Read only memory. There are five basic ROM types:

1.ROM
2.PROM.
3.EPROM.
4.EEPROM.
5.Flash memory.

Below is the screenshot taken of Motorola G5S which says smartphone have 4GB RAM and 32GB ROM. 

I want to know little bit more about particular types of ROM /RAM (from the types given above) used in the smartphone and reason behind using them. Can anybody tell me?
Moto G5S uses LPDDR3 DRAM, which is volatile (cleared on power cycle) Random Access Memory which can be confirmed with an app like DevCheck, and a 32GB flash storage chip which is non-volatile high-speed electrically programmable memory that is common to most modern cell phones although sizes can vary widely. 

Modern cell phones do not have a "ROM" or Read-Only Memory so to speak, although the term ROM is often used as a misnomer for the operating system... such as "My phone is running the custom ROM called LineageOS." which in this case is referring to a custom operating system residing in the /system partition. 

That said, many OEM's use the term "ROM" for the embedded storage in the device. Technically, this is not the correct the term for it at all. The storage, or ROM as the OEM is referring to it here, is the embedded storage flash chip which is usually partitioned with some parts accessible to the user and others protected from normal user access for use exclusively by the system.