This should get you most of the way there, with a few issues.
It only counts 2013 platform workflows.
I haven't found a way to limit the library count to only show document libraries, it counts all lists. If you can find that, the rest of the structure should work fine, you just need to point it at each site collection in turn.
$siteurl = "https://tenancy.sharepoint.com/sites/scname"
$tenancy = "https://tenancy.sharepoint.com"
$credentials = Get-Credential
Connect-PnPOnline -Url $siteurl -Credentials $credentials
$sites = Get-PnPSubWebs
Disconnect-PnPOnline
$WflowDefnCount = 0
$LibraryCount = 0
foreach ($site in $sites){
Connect-PnPOnline -Url "$tenancy$($site.ServerRelativeURL)" -Credentials $credentials
$Wflows = Get-PnPWorkflowDefinition
$WflowDefnCount =+ $Wflows.count
$Lists = get-pnplist
$LibraryCount =+ $Lists.count
}
Write-Host "Workflow count = $WflowDefnCount"
Write-Host "List count = $LibraryCount"