There's potential for deleted databases to show up as well, a join to sys.databases will prevent that:
SELECT
[database_name],
start_time AS 'LastCollectionTime',
storage_in_megabytes AS 'CurrentSize(MBs)',
allocated_storage_in_megabytes AS 'AllocatedStorage(MBs)'
FROM (
SELECT
ROW_NUMBER() OVER(PARTITION BY [database_name] ORDER BY start_time DESC) AS rn,
[database_name],
start_time,
storage_in_megabytes,
allocated_storage_in_megabytes
FROM sys.resource_stats
) rs
INNER JOIN sys.databases d ON d.name = rs.database_name
WHERE rn = 1
(with a performance hit as usual)